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


ExecDQL....


Started by John D. Alinson
Search
You will need to Sign In to be able to add or comment on the forum!

ExecDQL....

I have been downloading the a ExecDQL sample but I can't get it to work.

What do I do wrong?

Written by John D. Alinson 09/05/13 at 11:46:47 Dataease [{8}]FIVE

Re:ExecDQL....

Too little information to give a guaranteed correct answer but I think we can give some general pointers ;-)

ExecDQL is a completely new concept and might be a little hard to get around, but get used to it because you will see a lot more of this kind of "logic" in both DataEase 8 and DG3.

Up to ExecDQL business logic or code was always pre-made and fixed in DataEase. Every form, procedure and report would be share the same logic and only depending on the data-entry and switch cases could you get it to do different things in different circumstance. 

With ExecDQL (including the functions ExecDQL(), MemoExecDQL() and FileExecDQL()) this is no longer so. These are functions that interprets and execute a DQL script on the fly.

So what does this mean?

In extreme cases it means that you can generate a DQL script on the fly and then execute it making DataEase completely dynamic, but more "normally" it will interpret as you can match logic and response in forms.

In traditional DataEase you would have to "hardcode" the response to an action, but with ExecDQL that can be part of the configuration of the system. You can for instance match a drop down choice (multibox) with an action that is to be taken when that choice is made.

Let say that you are writing a letter and you then choose that it is an email, the logic for sending that email could be stored in the configuration part of your app to send that email, if it s a fax that logic is stored in the fax record in the configuration system etc.

Likewise you can decide where to navigate after the ExecDQL() dql have executed from inside the DQL by adding a DocumentOpen() action or a FormOpenRelated() action. The cool thing with ExecDQL is that it has both the PRISM context for the DQL and the Document context of the Form you call it from, so if you use FormOpenRelated() you will open a form related to the form, not the DQL.

I do understand that this can be a lot to take in, but we will make a lot of samples where the use is illustrated.

I think the problem you are having is that you try to execute the DQL in a blank form. For illustration in the sample we have included 3 record with 3 different DQL's saved directly in the DQL field. Just hit next and you will get the first record and then you can see how it works.

In real life you would not visually see the DQL to be executed and you would not type it into the form from where it is to be used. It will be saved in a configuration table and looked up, or in simple cases you can simply execute it directly.

Who hasn't wished for a function like this:

ExecDQL("Delete records in Table1 where Customer = data-entry field1",MyField,"","","","")

or

ExecDQL("Modify records in MyCustomers where Customernr=data-entry field1 and Date>data-entry field2",MyCustomer,MyDate,"","","","")

The first one will delete all the records that match the criteria and the second one will do an update.

When you realise that you can do this from any derivation, button etc. you realise that you can now suddenly manipulate data etc much more freely than before. 

ExecDQL does not generate any output or screen activity except on the status line or if you ask it to throw a message, no flashing, opening etc. 

Written by DataEase 09/05/13 at 11:53:48 Dataease [{8}]FIVE