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


list records in dql, but not printoutput


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

list records in dql, but not printoutput

If you need a "list records" in a DQL, but there sould be no output, you need the "in order" to account a result fore "enter a record", how can I do it. I have to page down all records on the window-output. if I delete the Layout, the procedure does not work.

example:

define temp "JA" text 4.

define temp "MO" text 2.

define temp "SA" numeric string 2.

define temp "AR" text 2.

define temp "SC" Number.

define temp "GE" Number.

delete records in SCHNITT with ARTKZ = "SS" .

for SCHNITT ;

list records

Jahr in order ;

Monat in order ;

Säge in order ;

ARTKZ2 in order .

if temp MO not = Monat or temp SA not = Säge then

if temp JA not = blank then

enter a record in SCHNITT

Jahr := temp JA ;

Monat := temp MO ;

Säge := temp SA ;

ARTKZ2 := "L" ;

ARTKZ := "SS" ;

Schnitte := temp SC ;

Gewicht := temp GE .

end

assign temp SC := Schnitte .

assign temp GE := Gewicht .

else

assign temp SC := temp SC + Schnitte .

assign temp GE := temp GE + Gewicht .

end

assign temp JA := Jahr .

assign temp MO := Monat .

assign temp SA := Säge .

assign temp AR := ARTKZ2 .

end

enter a record in SCHNITT

Jahr := temp JA ;

Monat := temp MO ;

Säge := temp SA ;

ARTKZ2 := "L" ;

ARTKZ := "SS" ;

Schnitte := temp SC ;

Gewicht := temp GE .

Written by Rainer 11/09/13 at 20:15:28 Dataease [{8}]FIVE

Re:list records in dql, but not printoutput

Hi Rainer.

The "traditional" DQL implementation in DFW has always been a "pain". It was never done properly back in 1994 and it has always let the product down.

PRISM (The Database/backend) and the GUI was supposed to be properly separated but when they implemented the DQL it was a botched job and they mixed it all up.

We retain the DFW DQL editor in DE8 Classic for backwards compatibility, but it is not part of the future.

The first step towards the future is DQL as a function - ExecDQL (ExecDQL(), MemoExecDQL() and FileExecDQL()

Read up on ExecDQL here...

http://www.dataease.com/DG3_ForumList/?ParentID=0000000175&field1=0000000175
http://www.dataease.com/DG3_ForumList/?ParentID=0000000229&field1=0000000229
http://www.dataease.com/DG3_BlogList/?ParentID=0000000112&field1=0000000112
http://www.dataease.com/DG3_BlogList/?ParentID=0000000090&field1=0000000090

ExecDQL is/will be one of the pillars of DE8 and it show how we think about DQL in the future.

In DFW it has been very formalized but in DE8 and in the future versions of DataEase it will be an all-round language.

Why shouldn't you be able to "program" everywhere and update stuff everywhere?

The cool stuff with ExecDQL is that it has two contexts.

1. The Data cursor context of the Multiview it is working on.
This is the "traditional" DQL angle where you update/delete/enter/list data etc.
2. The Object context of the form it is called from.
This is where you can manipulate the objects in the form you are calling the ExecDQL from. You can set a value in a field, or you can exit the DQL by opening a related form to the form you executed the DQL from...

Yes, it is conceptually challenging for a traditional DataEase thinker, but when you get your head around it, you will love it!

Written by DataEase 12/09/13 at 06:48:10 Dataease [{8}]FIVE

Re:Re:list records in dql, but not printoutput

Sorry! I guess I didn't completely answer your question in clear words.
ExecDQL doesn't generate any output except a CSV export file if you input a file name in the function.

History/Idea behind ExecDQL
http://www.dataease.com/DG3_BlogList/?ParentID=0000000078&field1=0000000078

Written by DataEase 12/09/13 at 07:08:17 Dataease [{8}]FIVE

Re:Re:Re:list records in dql, but not printoutput

My example ist a table with sales of artikel and my dqlstatement makes sum records for Articlegroups. It is fast and it is datadriven. Tell me how you would do it in DE8. The new records are entered in the same table as you see.

Written by Rainer 12/09/13 at 21:29:32 Dataease [{8}]FIVE

Re:Re:Re:Re:list records in dql, but not printoutput

Download Sample


Hi again Rainer.

It is a little difficult to use your DQL directly as we don't have the underlaying table it is supposed to manipulate.

So instead we made a little sample that showcase similar functionality (modify,delete, list records is the same same in all DQLs).

A DQL is not a report and that is where someone in charge went really wrong back in the early DFW days. In DFD it was called "Advanced Procedure" and then someone renamed it to "Advanced Report" in DFW... Big mistake!

The fact that you can build a report upon it (we do that extensively in DG3 and in DE8 Reporter) the clue is the processing.

Most people that used DQLs as Reports simply did so because of the Data-Entry form...

This sample showcase the opposite side of DQL, the one that involve everything but reporting....

As you see from our sample, it could easily have been a report at the end of this game too...

Enjoy!

Written by DataEase 13/09/13 at 14:42:12 Dataease [{8}]FIVE

Re:Re:Re:Re:Re:list records in dql, but not printoutput

I see that is very useful. Can you call a DQL allso like this?

Written by Rainer 14/09/13 at 20:15:23 Dataease [{8}]FIVE

Re:Re:Re:Re:Re:Re:list records in dql, but not printoutput

Yes, ExecDQL is just DQL without the Data-Entry form and the GUI body.

The syntax is the same and you can use all the same functions. The only main difference is that it generates no output (except a CSV file which is very quick way to export data).

You can of course generate output from it like we have shown in examples, but you simply don't have to be bothered by the invasive GUI of the DQL Document.

In ExecDQL you are much freer and as you have seen, you can manipulate and integrate it in your programming something the invasive way DQL Document works, you never was able to before.

The only thing one need to remember is that Data-Entry works differently and that calling another ExecDQL has to be done differently than calling another procedure from DQL Document.

Traditional DFW DQL is a document like Form/Report. When you call it, it is completely unrelated to the context from where it is called.

You can call it with the command Run Procedure , which will basically just open the document and execute the DQL.

In DQL there is a big difference between "Commands" and "Functions". A command can only be called in the correct place and context, when a Function can be basically triggered anywhere.

A command will stand on its own two feet, but a function need to be allocated to a context

Ex.
...
run procedure "Members" .

vs

retval := MemoExecDQL(any DQLStore with DQLNr=data-entry DQLnr DQLBody,data-entry field2, "Customer","","","C:\myexport.txt") .


As you see a ExecDQL can be triggerd anywhere in an app and also anywhere in a DQL... You can in fact trigger it anywhere you can use any function, which is practically anywhere in the entire DataEase.

concat("My DQL is executing,ExecDQL("delete records in maintable.","","","","",""),"And that was it")

Only thing you need to think of when you are executing DQL's left right and center in another DQL is the Data Cursor/Locking.

For integrity DataEase need to lock data/files inside a cursor so if you try to delete the data that the DQL you are calling the other DQL from in the second one it will not work.

Some more examples:

define "Retval" text .

retval := MemoExecDQL(Any DQLStore with DQLNr="301" DQL,"","","","","") .

retval := MemoExecDQL(Any DQLStore with DQLNr="302" DQL,"","","","","") .

retval := MemoExecDQL(Any DQLStore with DQLNr="303" DQL,"","","","","") .

will basically simply execute 3 different DQLs in a chain. The DQL will be stored in the MemoField DQl in the Table DQLStore and the identifying unique value is DQLNr (which is just a sequence number or something), you can of course use DQL name or any other Identifier you like.



Written by DataEase 15/09/13 at 07:16:50 Dataease [{8}]FIVE

Re:Re:Re:Re:Re:Re:Re:list records in dql, but not printoutput

I tried but i did not get it going. My statment:

The Form/record my sample starts: The Fileds: MANR ,Eintritt ,Urlaubsanspruch

"Execute Funktion/Derivation"

ExecDQL("enter a record in BEWEGUNGEN MANR := data-entry field1 ; Tag := data-entry field2 ; BewegungsartNR := "UA" ; Wert := data-entry field3 .",MANR ,Eintritt ,Urlaubsanspruch ,"","") or

ExecDQL("enter a record in BEWEGUNGEN MANR := MANR ; Tag := Eintritt ; BewegungsartNR := "UA" ; Wert := Urlaubsanspruch .",MANR ,Eintritt ,Urlaubsanspruch ,"","") or??

Written by Rainer 15/09/13 at 18:43:29 Dataease [{8}]FIVE

Re:Re:Re:Re:Re:Re:Re:Re:list records in dql, but not printoutput

This is why you need to use MemoExecDQL() and not ExecDQL

ExecDQL is the "simple" form, but as DQL use " quite a lot and the input value of ExecDQL is Text, you need to concatinate in or use a field as input.

ExecDQL("enter a record in BEWEGUNGEN MANR := data-entry field1 ; Tag := data-entry field2 ; BewegungsartNR := "UA" ; Wert := data-entry field3 .",MANR ,Eintritt ,Urlaubsanspruch ,"","")

This is the problem. "UA"

The first parameter was now ended at the begining of the UA and the syntax is now illegal.

Any action or derivation in DFW is limited to 255 characters, sot he entire statement cannot be longer than that, so the effective DQL you can execute with ExecDQL is hence 255 if you reference a field either in the form or lookup/any and a lot less if you write it directly.

You functions should look like this.

ExecDQL(concat("enter a record in BEWEGUNGEN MANR := data-entry field1 ; Tag := data-entry field2 ; BewegungsartNR :=",chr(34),"UA" ,chr(34),"; Wert := data-entry field3 .",MANR ,Eintritt ,Urlaubsanspruch ,"","")

CHR(34) is " and CHR is a new function in DE8. http://www.dataease.com/dg3_HelpView/?PageID=10317&field1=*Chr*

We only recommend that you use ExecDQL directly this way for very small and nimble DQLs like:

ExecDQL("Delete records in MyTable.","","","","","").

For larger DQL's we recommend that you save them in a Table and look them up and execute them. That way you can re-use them many places. It is a very quick and effective method.

It might be a little "novel" as programming have now bridge the gap between App development and the App itself, but it is a very powerful tool when one "grasps" it.

We will publish an ample amount of samples and demonstration videos over the upcoming moths.


Written by DataEase 16/09/13 at 09:48:35 Dataease [{8}]FIVE