prismrun.exe is a boot strap version of DataEase to be used for scheduled task trough the windows scheduler or simply to run long lasting DQLs without having to wait for them to finish in the GUI.

How to use

When calling prismrun it will look at the number of parameters and calculate what to set. prismrun must always have a App to run in and what to run with eventually a query for input data.

RepoPath The absolute path the the repository (App) to be used by DERun
RepoName
The name of the repository (App)
UserName User name used to log in to the repository
Password The password for the user used to log in to the repository
DQL How to locate the dql code to run. This can be the search name in a table, a filename (if starts on \\ or have : at second position like \\serverpath\dir\dlq.dql or c:\mydqls\dql.dlq) or #id or @name that will locate the dql in the defined dql store.
[Body]
Pointer to body to use. Can use same model as for the DQL to locate the body.
[Query] Used to add data-entry to use in DQL. In ExecDQLs called by @ and # this will be field1-4=val. For server dql you can use and name=val
-prefix
The prefix to use for settings. Default is server.

What the program reads the parameters and find the correct dql

The default for finding a DQL is

 - start on @ or # is a execdql to be read from dql store defined in rdrrXaaa.ini in the app folder.

 - start on \ or second char is : this is a file based dql and is read from the given file name.

- all others are server DQL stored in the WebServer table (or a different defined table based on setting given in -prefix=sectionname)

When executing server dql

When you give a name without @ or # in the start, what you will run is a server DQL. A name not starting on \\ or with a : at post 2 will be looked up as the field Name in the WebServer (or defined in -prefix) table. Any errors on finding the DQL or running it will be returned as a json string. The dql if all goes well will return whatever is defined by body or JSON if json=1 is set in the query string.

Query
What is do
getbodytree=1
Will add a compiled body tree to the json output
getdefinition=1
Will return the structure of the list records output as a field definiton
json=1
Will return the data from the dql as server json structure.
jsonpretty=1
Will make json human readable.

The table will be looked up in ini section of what is set in -prefix (default to [server]) in WebTable=tablename. If blank WebServer will be used. The only fields used in this table by the prismrun is Name for lookup first match and Code for running as a server page.

When executing a execdql

When you have used a @ or in the name of the dql, the execdql and execbody are looked up in a table defied in rdrrXaaa.ini. Make sure to set a @/# name in both the section for body and code as they can be looked up individually. If you want if from the same record, just use same name in both.

DqlBodyField
The name of the field used for the DQL body code. Default is DQLBody.
DqlCodeField
The name of the field used for the DQL script code. Default is DQLScript.
DqlIDField
The name of the field used for #number in the table. Default is DQLId.
DqlNameField
The name field used for @name in the table. Default is DQLName.
DqlTableName
The table to use for ExecDQL calls. Default is $$DQLStore$$.

The ini section used are first what is set in -prefix (default to [server]) then if result is blank then use what is in [EXECDQL] section. If that is blank use the defaults.

Examples of use

prismrun "C:\Data\My App with space in name" TheApp MyUser MyPass BackupApp

This will start a task in the TheApp application with user name MyUser and password MyPass and run a job description in the standard WebServer table with Name="BackupApp" and no query. The name of the app folder is with "" as there are space(s) in the folder name.

prismrun C:\Data\MyApp TheApp MyUser MyPass C:\Data\MyApp\MyDql.dql name=Alfred&code=3159

This will run a file based DQL that can be found the the app path and it will pick up data-entry values for name and code

prismrun "C:\Users\me\Documents\My DataEase\MyApp" TheApp MyUser MyPass @TheTask "@TheTask"

This will run a ExecDQL and a body stored in the defined dql store for the the given app without input using parameters