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


Why should I use ExecDQL rather than traditional DQL?

Started by DataEase
You will need to Sign In to be able to comment on the Blog!

Why should I use ExecDQL rather than traditional DQL?

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 first about the smallest one in the class and the one that gave the class it's name.

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 08:01:46 Dataease [{8}]FIVE

Re:Why should I use ExecDQL rather than traditional DQL?

Very interesting way of programming! Can I get a sample database with Calendar in version 8.2 ? Thanks.


Written by Marco Marchesi 15/10/15 at 08:53:43 Dataease [{8}]FIVE