

To run a DQL script as a function from anywhere.
DQL is the most useful part of a DE application but it has had its limitations because it has been part of the DQL document (report). With ExecDQL we have liberated it, and you can now call a DQL from anywhere at anytime. It follow normal DQL syntax rules and it will generate an variable length export file if you include a file name as the last parameter (parameter 6).
Because it is a function you have to reference the Data-entry fields (transfered as parameter 2-5) with fixed names i.e Field1, Field2, Field3 and Field4. Other than that it is completely traditional DQL.
The ExecDQL has the GUI context of the document from where it is called, so you can read and manipulate the document from the DQL. This means that ExecDQL is not only a Data manipulating procedure it can also be a GUI manipulating procedure.
If you need more input variables than 4 you can simply pick them out of the Form you are calling the ExecDQL from with GetValue()
To make ExecDQL and other parts of DE8 more effective we have also introduced ESCAPE values in DE8 Strings.
Early in 8.0 we introduced CHR() to make it easier (possible) to use reserved letters in DE derivations and DQL etc. However it is a little awkward when you have to use ConCat() to joint things together for instance in a ExecDQL etc.
Ex.
ExecDQL(concat("message ", chr(34), "Hello world!",chr(34)," window.","","","","","")
So now you can simply do this with the escape charcter for ".
Ex.
ExecDQL("Message /'Hello World!/' window .")
The observant reader also see that we don't add all the "" at the end of the function. This is news in 8.2 too. We have introduced variable number of parameters to make the functions more user friendly.
Up to now you had to be exact with your parameters and that could be a chore when the only thing you wanted was to execute a small line of commands with no export, and no input.
You will still have to follow the numbers so if you want to include an export file for ExecDQL you will need to include 4 empty "" as parameters before the export file name, but if you only need two data-entry parameters you can now simply add the two and skip the 3 last parameters.
When using @ or # to lookup a execdql by name or ID, there are default, but you can also change these by settings in RDRRxAAA.INI. If nothing is set, a table named $$DQLStore$$ is used with the following fields for code, body, id and name: DQLScript, DQLBody, DQLId and DQLName.
| DqlCodeField | Gives the name of the memo field that is used for dql body in execdql using either @name or #id for looking it up. Default is "DQLScript". |
| DqlBodyField | Gives the name of the memo field that is used for dql code in execdql using either @name or #id for looking it up. Default is "DQLBody". |
| DqlIDField | Gives the name of the field that is used to lookup #id in execdql. The field have to be a numeric field. Default is "DQLId". |
| DqlNameField | Gives the field name used to lookup the @name used in execdql. The field have to be a text field. Default is "DQLName". |
| DqlPath | Where execdql should look first when you have a *:dqlfile.dql for name or *:bdyfile.bdy for body in execdql |
| DqlSecurityField >=7308 | The name of a field that can hold security settins for server based execdql form dql store. This field can be a text field or a choice field. Values supported is High, Medium1-3, Low1-3 and None. None is anybody can run and should be used with care. Default is "DQLSecurity". |
| DqlTableName | Gives the execdql table name for @name and #number calling execdql. Default is "$DQLStore$". |
All of this has to be set in the [EXECDQL] section unless used in server as you can have one for each prefix set and set it direct into this section instead.
Filters manipulated the data comming from list records and rewirte it to something else before putting any formatting on. You can have as many filters as you want chained by seperating them with a SPACE. To add a filter use |filtername. Ex. [{repopath|tojsonstring}] to escape the \ characters in the path as used in json.
|tojsonstring - convert the string to something that can be used in json output. All illegal characters will we escaped like \ -> \\ and CR to \n
|fromjsonstring - take a json string input and make it back to DE.
|toutf8 - take a DE string and transform it to UTF8
|fromutf8 - take a UTF8 string and transform it to DE
|tojsonstringutf8 - do an escape to json string and also transform to UTF8
|fromjsonstringutf8 - take a UTF8 json string and transform it to DE
|urlencode - url encode a string to be used in a browser
|urldecode - take a url encode string and make it into DE string.
DQL: (String)
Here you can write a DQL script up to 255 characters long. It can do anything a DQL can do and has the same format as any other DQL
Data-Entry Field1: (String)
This is the parameter that you can reference inside the DQL script as Data-Entry field1.
Data-Entry Field2: (String)
This is the parameter that you can reference inside the DQL script as Data-Entry field2.
Data-Entry Field3: (String)
This is the parameter that you can reference inside the DQL script as Data-Entry field3.
Data-Entry Field4: (String)
This is the parameter that you can reference inside the DQL script as Data-Entry field4.
Output: (Field)
There is several different output modes for MemoExecDQL.
File: (Default)
If you use the reserved keyword file: or refrain from using a reserved keyword in the Output argument the argument will be interpreted as a text file and the export will be saved in this file name.
ex: ExecDQL(DQL,"","","","","C:\test.txt",Layout) or : MemoExecDQL(DQL,"","","","","file:C:\test.txt",Layout)
Web:
This is the HTML mode. The output will now be interpreted as HTML and you can either Print it or Preview the output in the IE object. When using the Web: keyword you have extra formatting.
Web:<printer>,<mode> ex. ExecDQL(DQL,"","","","","web:Default,1",Layout) -- this will preview the Result in the IE object.
<printer> -- Default, Printer1..Printer4, Actual name of printer. -- The default printer in WIndows will be changed to this printer.
<mode> -- 0,1 - Preview, 2 - Print Directly to printer without dialog, 3 - printer dialogue.
PDF:
Print directly to PDF. PDF:<filename>. Ex. ExecDQL(DQL,"","","","","PDF:c:\test\mypdf.pdf",Layout)
PDF formatting is available by adding switches after the PDF filename by seprating the file name inside the "" with comma (,) ex.
ExecDQL("@MyDQL","","","","","PDF:c:\test\mypdf.pdf,-O Landscape
===============================> Global Options <===============================
--collate Collate when printing multiple copies (default)
--no-collate Do not collate when printing multiple copies
--copies <number> Number of copies to print into the pdf file (default 1)
-d, --dpi <dpi> Change the dpi explicitly (this has no effect on X11 based systems)
-H, --extended-help Display more extensive help, detailing less common command switches
-g, --grayscale PDF will be generated in grayscale
-l, --lowquality Generates lower quality pdf/ps. Useful to shrink the result document space
--manpage Output program man page
-B, --margin-bottom <unitreal> Set the page bottom margin
-L, --margin-left <unitreal> Set the page left margin (default 10mm)
-R, --margin-right <unitreal> Set the page right margin (default 10mm)
-T, --margin-top <unitreal> Set the page top margin
-O, --orientation <orientation> Set orientation to Landscape or Portrait
(default Portrait)
--output-format <format> Specify an output format to use pdf or ps, instead of looking at the extention of the
output filename
--page-height <unitreal> Page height
-s, --page-size <Size> Set paper size to: A4, Letter, etc.
(default A4)
--page-width <unitreal> Page width
More switces available, see documentation on HtmlToPdf()
Memo:
Will put the output directly into a Memo GUI control in the active form. If the GUI control is a WebField it will display HTML correctly.
PS! If you output formatted text to a text memo, remember to use COURIER or another fixed position font.
ExecDQL was designed to cover two major flaws in the DQL hierarchy of DFW. Manipulation and export so if you add a file name her and a list records in the DQL it will create a CSV file with column headers where the columns are in the order you put them in the list records.
If you have added a body to the execdql either by writing it into the field or adding it from $$DQLStore$$ by @name, #id or LE9 7022> ~formbodyname, you can use this text format to merge data genereted in the list records
A body must have at least a .item and .end starting from pos 0 in line to work.
.header - header elements in body if dql is multilevel
.group header - a group header elements in body if dql is multilevel and have in group
.items - start of main level list records items
.footer - footer elements if multilevel dql
.group footer - a group footer elements if multilevel dql and have a in group, this is mostly used for aggregate at group level
.end - end of last level list records items
.page insert a html page break
.if value - check if field from list records is blank or not
.else - field from list records was blank so do from here
.endif- end if if
A live text i the exact name of a field used in a list records and will be replaced with value representing the list records field.
A livetext can have formating, be aggregate and from LE9>7037 have filters.
The formatting in livetext comes as :format in the live text. Ex [{price:F6.2}] will format a number form DE with 6 digits and 2 decimals using . as decimal seperator.
:F - decimal (float as D is used by date)
:I - integer
:D - date - how to format a date, can use yYmMdD with any seperators. Ex. [{orderdata:Ddd/mm/YYYY}]
:T - time - how to format the time using hHmMsS with any seperators. Ex. [{starttime:THH:MM}]
:R - right with padding
:C - center with padding on both sides
:L - left with padding
This is used to tell what aggregate to use from the list records. The name is the sam as used there and can be direct after the : of after the format seperated by a space. Ex. [{orderline:sum}] ot [{orderline:F7.2 sum}]
:item
:sum
:percent
:mean
:max
:min
:count
:variance
:std.dev.
:std.err.
Filters manipulated the data comming from list records and rewirte it to something else before putting any formatting on. You can have as many filters as you want chained by seperating them with a SPACE. To add a filter use |filtername. Ex. [{repopath|tojsonstring}] to escape the \ characters in the path as used in json.
|tojsonstring - convert the string to something that can be used in json output. All illegal characters will we escaped like \ -> \\ and CR to \n
|fromjsonstring - take a json string input and make it back to DE.
|toutf8 - take a DE string and transform it to UTF8
|fromutf8 - take a UTF8 string and transform it to DE
|tojsonstringutf8 - do an escape to json string and also transform to UTF8
|fromjsonstringutf8 - take a UTF8 json string and transform it to DE
|urlencode - url encode a string to be used in a browser
|urldecode - take a url encode string and make it into DE string.
This parameter is used for setting command and values that is changing how the dql run and what it will output. The format is cmd1=val1&cmd2=val2&cmd3=val3...
The supported commands at the moment are: tdf, includenameinheader, allasstring and exportfielddelimiter.
All this values can be set in document properties and the .dql format as well. Extra paramters will always override the other two ways of setting. Order is document properties, .dql settings and extraparameters.
.dql format uses .cmd value and due to this commands that can have SPACE, TAB, CR and LF can use this alias for the character.
set output to tdf mode and can have the following values
Full tdf with all levels use: fullonly
Tdf with only levels with fields or aggregates (this is what is uses by execdql): 1, true, yes and cleanedonly
Any other values means not use tdf of turn of if set in any other place.
Set A true false value if adding header in first line with the field names in export.
1, positive value, true and yes means to use header all others not to use header.
Export all csv values as string with "" around the value.
1, positive value, true and yes means to use string values all others not to use string values.
The delimiter to use between fields in the export. Default is ~ as all exports in DataEase. Can use SPACE, TAB, CR and LF instead of these names as some was of setting it removes white space. If not it will be the character after = og space for . commands.
<br><br><pre></pre>
If you use this tag around your output, the resulting code will be treated as TEXT i.e. space, line feed and position will be honoured (DFD mode)
GetValue()
MemoExecDQL()
LabelExecDQL()
TextExecDQL()
StringEscape()

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

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

Product: Dataease [{8}]FIVE. Written by Arul 25/07/13 at 08:35:43

Product: Dataease [{8}]FIVE. Written by DataEase 25/07/13 at 08:36:12

Product: Dataease [{8}]FIVE. Written by Arul 30/09/13 at 08:05:08

Product: Dataease [{8}]FIVE. Written by DataEase 30/09/13 at 10:14:20

Product: Dataease [{8}]FIVE. Written by Fatma 01/10/13 at 09:31:01

Product: Dataease [{8}]FIVE. Written by DataEase Tech Sup 01/10/13 at 09:31:36

Product: Dataease [{8}]FIVE. Written by Peter Birney, PB Associates 16/12/13 at 11:10:33

Product: Dataease [{8}]FIVE. Written by DataEase 17/12/13 at 11:04:46

Product: Dataease [{8}]FIVE. Written by Peter Birney, PB Associates 17/12/13 at 11:47:59

Product: Dataease [{8}]FIVE. Written by DataEase 17/12/13 at 14:24:22

Product: Dataease [{8}]FIVE. Written by Peter Birney, PB Associates 17/12/13 at 14:30:37

Product: Dataease [{8}]FIVE. Written by DataEase 18/12/13 at 13:55:34

Product: Dataease [{8}]FIVE. Written by Graham Brown 09/03/14 at 17:48:31

Product: Dataease [{8}]FIVE. Written by DataEase 10/03/14 at 09:33:05

Product: Dataease [{8}]FIVE. Written by 25/03/14 at 12:58:36

Product: Dataease [{8}]FIVE. Written by DataEase Tech Sup 28/03/14 at 18:50:56

Product: Dataease [{8}]FIVE. Written by George Washington 30/05/14 at 14:55:58

Product: Dataease [{8}]FIVE. Written by George Washington 11/06/14 at 06:31:28

Product: Dataease [{8}]FIVE. Written by Mr. DataEase 11/06/14 at 11:02:44

Product: Dataease [{8}]FIVE. Written by Rainer 13/09/14 at 19:39:41

Product: Dataease [{8}]FIVE. Written by DataEase Tech Sup 14/09/14 at 09:16:12

Product: Dataease [{8}]FIVE. Written by Rainer 15/09/14 at 06:56:08

Product: Dataease [{8}]FIVE. Written by DataEase 15/09/14 at 11:35:39

Product: Dataease [{8}]FIVE. Written by Rainer 15/09/14 at 21:13:35

Product: Dataease [{8}]FIVE. Written by DataEase Tech Sup 16/09/14 at 08:18:15

Product: Dataease [{8}]FIVE. Written by Rainer 16/09/14 at 10:11:58

Product: Dataease [{8}]FIVE. Written by DataEase Tech Sup 16/09/14 at 12:27:53

Product: Dataease [{8}]FIVE. Written by DataEase Tech Sup 18/09/14 at 11:44:03

Product: Dataease [{8}]FIVE. Written by Graham Brown 22/10/14 at 13:23:46

Product: Dataease [{8}]FIVE. Written by DataEase 22/10/14 at 19:30:38

Product: Dataease [{8}]FIVE. Written by Rainer 08/11/14 at 09:46:04

Product: Dataease [{8}]FIVE. Written by DataEase 10/11/14 at 06:33:59

Product: Dataease [{8}]FIVE. Written by Rainer 10/11/14 at 11:35:40

Product: Dataease [{8}]FIVE. Written by Rainer 10/11/14 at 11:42:25

Product: Dataease [{8}]FIVE. Written by Rainer 10/11/14 at 21:47:54

Product: Dataease [{8}]FIVE. Written by DataEase 11/11/14 at 09:07:58

Product: Dataease [{8}]FIVE. Written by DataEase 11/11/14 at 09:14:39

Product: Dataease [{8}]FIVE. Written by DataEase 11/11/14 at 09:16:02

Product: Dataease [{8}]FIVE. Written by Tor Nerland 12/11/14 at 09:42:53

Product: Dataease [{8}]FIVE. Written by DataEase 12/11/14 at 10:53:54

Product: Dataease [{8}]FIVE. Written by Rainer 17/11/14 at 15:33:54

Product: Dataease [{8}]FIVE. Written by Rainer 17/11/14 at 16:09:08

Product: Dataease [{8}]FIVE. Written by DataEase Tech Sup. 17/11/14 at 18:23:26

Product: Dataease [{8}]FIVE. Written by Rainer 19/11/14 at 14:20:03

Product: Dataease [{8}]FIVE. Written by DataEase Tech Sup. 19/11/14 at 19:44:12

Product: Dataease [{8}]FIVE. Written by Rainer 20/11/14 at 11:09:59

Product: Dataease [{8}]FIVE. Written by Rainer 20/11/14 at 11:58:12

Product: Dataease [{8}]FIVE. Written by Rainer 26/11/14 at 07:50:42

Product: Dataease [{8}]FIVE. Written by DataEase 26/11/14 at 09:23:28

Product: Dataease [{8}]FIVE. Written by Rainer 26/11/14 at 14:35:03

Product: Dataease [{8}]FIVE. Written by DataEase 26/11/14 at 14:35:52

Product: Dataease [{8}]FIVE. Written by George Washington 07/01/15 at 08:07:23

Product: Dataease [{8}]FIVE. Written by Kensington 07/01/15 at 11:11:56

Product: Dataease [{8}]FIVE. Written by DataEase 07/01/15 at 13:01:23

Product: Dataease [{8}]FIVE. Written by George Washington 08/01/15 at 10:12:10

Product: Dataease [{8}]FIVE. Written by Arul 26/02/15 at 07:17:12

Product: Dataease [{8}]FIVE. Written by DataEase 26/02/15 at 07:19:06

Product: Dataease [{8}]FIVE. Written by Arul 26/02/15 at 14:36:05

Product: Dataease [{8}]FIVE. Written by DataEase 26/02/15 at 14:36:29

Product: Dataease [{8}]FIVE. Written by Jeyarajah Arulrajah 27/02/15 at 18:40:45

Product: Dataease [{8}]FIVE. Written by DataEase 28/02/15 at 14:18:41

Product: Dataease [{8}]FIVE. Written by Dave 22/06/15 at 08:53:08

Product: Dataease [{8}]FIVE. Written by DataEase 22/06/15 at 09:00:48

Product: Dataease [{8}]FIVE. Written by DataEase 23/06/15 at 09:25:04

Product: Dataease [{8}]FIVE. Written by Jeyarajah Arulrajah 23/06/15 at 12:52:17

Product: Dataease [{8}]FIVE. Written by Jeyarajah Arulrajah 23/06/15 at 13:27:46

Product: Dataease [{8}]FIVE. Written by Jeyarajah Arulrajah 23/06/15 at 13:34:58

Product: Dataease [{8}]FIVE. Written by DataEase 23/06/15 at 13:49:48

Product: Dataease [{8}]FIVE. Written by DataEase 23/06/15 at 13:55:56

Product: Dataease [{8}]FIVE. Written by Jeyarajah Arulrajah 23/06/15 at 14:00:31

Product: Dataease [{8}]FIVE. Written by DataEase 23/06/15 at 15:36:39

Product: Dataease [{8}]FIVE. Written by Jeyarajah Arulrajah 23/06/15 at 17:37:40

Product: Dataease [{8}]FIVE. Written by DataEase 23/06/15 at 18:17:56

Product: Dataease [{8}]FIVE. Written by DataEase 23/06/15 at 21:13:15

Product: Dataease [{8}]FIVE. Written by DataEase 07/07/15 at 14:22:43

Product: Dataease [{8}]FIVE. Written by Jeyarajah Arulrajah 07/07/15 at 14:48:37

Product: Dataease [{8}]FIVE. Written by DataEase 07/07/15 at 16:48:19

Product: Dataease [{8}]FIVE. Written by Jeyarajah Arulrajah 08/07/15 at 13:32:19

Product: Dataease [{8}]FIVE. Written by DataEase 08/07/15 at 13:45:45

Product: Dataease [{8}]FIVE. Written by DataEase 13/07/15 at 19:09:21

Product: Dataease [{8}]FIVE. Written by Simon B 15/07/15 at 10:55:41

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

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

Product: Dataease [{8}]FIVE. Written by Marco Marchesi 15/10/15 at 13:19:36

Product: Dataease [{8}]FIVE. Written by DataEase 16/10/15 at 16:26:35

Product: Dataease [{8}]FIVE. Written by DataEase 21/10/15 at 08:46:54

Product: Dataease [{8}]FIVE. Written by DataEase 17/11/15 at 07:29:30

Product: Dataease [{8}]FIVE. Written by Jeyarajah Arulrajah 17/11/15 at 14:11:31

Product: Dataease [{8}]FIVE. Written by Kensington 17/11/15 at 15:11:50

Product: Dataease [{8}]FIVE. Written by DataEase 18/11/15 at 09:58:14

Product: Dataease [{8}]FIVE. Written by DataEase 18/11/15 at 10:08:37

Product: Dataease [{8}]FIVE. Written by charmaine smit 27/11/15 at 07:53:48

Product: Dataease [{8}]FIVE. Written by DataEase 27/11/15 at 08:02:02

Product: Dataease [{8}]FIVE. Written by DataEase 30/12/15 at 15:09:30

Product: Dataease [{8}]FIVE. Written by grohmann.papier@t-online.de 30/12/15 at 19:01:02

Product: . Written by Mohd Sedik Zakaria 12/04/16 at 01:35:11

Product: . Written by Fatma Adel 12/04/16 at 09:36:05

Product: Dataease [{8}]FIVE. Written by DataEase 01/03/13 at 13:36:04

Product: Dataease [{8}]FIVE. Written by DataEase 14/04/13 at 18:49:17

Product: Dataease [{8}]FIVE. Written by DataEase 25/07/13 at 18:24:45

Product: Dataease [{8}]FIVE. Written by DataEase 13/09/13 at 14:47:24

Product: Dataease [{8}]FIVE. Written by DataEase 16/09/13 at 13:31:43

Product: Dataease [{8}]FIVE. Written by DataEase 19/11/13 at 18:23:25

Product: Dataease [{8}]FIVE. Written by DataEase 01/04/14 at 16:12:14

Product: Dataease [{8}]FIVE. Written by DataEase 24/04/14 at 08:49:04

Product: Dataease [{8}]FIVE. Written by DataEase 05/06/15 at 18:55:35

Product: Dataease [{8}]FIVE. Written by Jeyarajah Arulrajah 06/06/15 at 01:41:39

Product: Dataease [{8}]FIVE. Written by 06/06/15 at 01:41:39

Product: Dataease [{8}]FIVE. Written by DataEase 07/07/15 at 11:49:54

Product: Dataease [{8}]FIVE. Written by Jeyarajah Arulrajah 07/07/15 at 14:36:56

Product: Dataease [{8}]FIVE. Written by DataEase 07/07/15 at 15:41:00

Product: Dataease [{8}]FIVE. Written by DataEase 13/07/15 at 16:48:31

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

Product: Dataease [{8}]FIVE. Written by DataEase 25/09/15 at 08:01:46

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

Product: Dataease [{8}]FIVE. Written by DataEase 27/11/15 at 10:15:23

Product: Dataease [{8}]FIVE. Written by DataEase 30/12/15 at 15:29:44

Product: Dataease [{8}]FIVE. Written by Marco Marchesi 25/10/16 at 10:31:48

Product: Dataease [{8}]FIVE. Written by Marco Marchesi 25/10/16 at 11:51:39

Product: Dataease [{8}]FIVE. Written by DataEase 17/03/17 at 17:09:04

Product: Dataease [{8}]FIVE. Written by Rainer 17/03/17 at 21:12:27

Product: Dataease [{8}]FIVE. Written by DataEase 19/03/17 at 20:31:09

Product: Dataease [{8}]FIVE. Written by DataEase 02/07/17 at 16:54:26

Product: Dataease [{8}]FIVE. Written by DataEase 09/06/20 at 18:50:01

Product: LegEasy 9 Developer. Written by DataEase 08/11/24 at 15:16:23