Easy to Create, Easy to Change - Easy to use!


How do I run more than 1 Delete Records in an EXECDQL


Started by Charmaine
Search
You will need to Sign In to be able to add or comment on the forum!

How do I run more than 1 Delete Records in an EXECDQL

Morning,

It is me again ... Hope you are well.

I have a two Questions (for now ......)

How do I run more than 1 Delete Records in an EXECDQL ?

eg

Delete records in FORMA

delete records in FORMB

delete records in formC etc

Can I call a ExecDQL from a DQL and how ?

(I have a Control Procedure for 20 DQL , and I want to move some of them to EXECDQL , but still run it from the Control Procedure ? )

Thanks

Charmaine

Written by Charmaine 25/09/15 at 07:48:34 Dataease [{8}]FIVE

Re:How do I run more than 1 Delete Records in an EXECDQL

Hi Charmaine.


To be honest, you should get all away from using old style DQL?s (for new stuff, don?t have to rewrite stuff of course).

ExecDQL is ?million? times faster, close to 100% stable (I know how the DE community love that word…), it can be used anywhere and without any ?detrimental? impact on the performance or execution of the app. Where a ?old style? DQL looks like a 3 year looking for stuff in their toy box, ExecDQL executes like a shark through black water …hehe.

With ExecDQL you can forget all about temp global to transfer between DQL?s and you can forget about control procedures etc.

As ExecDQL (including MemoExecDQL, LabelExecDQL and FileExecDQL) are simply functions you can call them from anywhere and in any combination.

It is actually a hack to call delete records in ExecDQL like this.


--My DQL
define ?retval? text .

Retval := ExecDQL(?Delete records in MyTable . ?) .
for MyTable with etc…

So why do we do this?

As you know a DQL lock a table so when you want to delete data in the same table as Is part of the main ?activity? in the DQL you can experience that you won?t be able to do it. In the ?old? days this would be solved by using a control procedure and do the delete records there, but as you see that is no longer necessary.

So back to your question.

I gather you are talking about the smallest ExecDQL function the ?namer? of the class?

ExecDQL().

It?s brilliance and shortcoming is that it contain the DQL as an argument, but as long as you keep with 255 it can do ?everything?.

If you want to do more than one Delete Records it is normal DQL rules.

ExecDQL(?delete records in FormA . Delete records in FormB . Delete Records in FormC .?) ? will work a breeze.

As . is the decimal separator in DataEase programming it is always advisable to keep a space in front of it. It is not necessary here I think but as a rule of thumb…

You can of course call ExecDQL from a control procedure if you like, but as it is a function it need to be allocated to a variable etc.

define ?retval? text .

Retval := ExecDQL(etc.).

you can also call a MemoExecDQL like this.

retval := MemoExecDQL(any ExecDQLstore with DQLNr=021 DQL,CustomerNr,Arg2, etc)

You can even do this.

define ?retval? text .

for ExecDQLStore with KeyWord=?EndOfYear? ;
list records
DQLNr in order .

retval := MemoExecDQL(DQL) . ? this will now execute in sequence all the DQLs that fit the Keyword…
end

The sky is the limit with ExecDQL. Have you played with the Layout yet. That is even more awesome.

The little "taster" at the top is a creation of a Monthly calendar with content simply with a simple MemoExecDQL with a HTML body...Power to the people!

Written by DataEase 25/09/15 at 07:56:54 Dataease [{8}]FIVE