Defining the parameter file
The lines in the parameter file cannot exceed 512 characters (including comments). It is possible to use lower or upper case letters or a mixture of both. PSDB converts everything sent to the database to capital letters (only strings surrounded by a pair of ("") or a pair of ("") are not converted). The PSDB interface interprets the parameter file line by line. The interpretation of a line depends on the first character in the line (leading blanks are stripped). The different PSDB keywords are described below. Lines not starting with a PSDB keyword are interpreted as part of a SQL statement and are to the string that holds the SQL statement.
Empty lines are skipped and lines starting with an exclamation mark "!" are also skipped.
STATEMENT
The parameter file consists of several statements. A parameter file statement defines one or more commands (SQL statements) that are sent to the database. Each parameter file statement can be executed from M3 PWB.
A statement definition starts by declaring the name of the statement in square brackets:
Statement | Description |
---|---|
@TITLE | During the execution of a statement, you can display the
statement in M3 PWB description. This text is written by using a title definition
line: @TITLE=<Text describing statement> |
@CONVERTCHARS | The @CONVERTCHARS line is used to state that fields of type
CHAR should be converted. The conversion means
that all characters received from the database are
converted to the actual Windows character set, and
all characters sent to the database are converted
from the actual Windows character set. To receive
national characters from the database, you might require to use this option.
Likewise you might require to use the option when inserting data with national
characters into the database from M3 PWB. The @CONVERTCHARS line has only effect
within the statement is placed. |
@ARRAY | If @ARRAY is used an array buffer is used when sending or
receiving data. This means that several lines are sent and received simultaneously.
The PSDB keeps track of when to retrieve or send lines from the database again. This
can give a performance gain. The syntax of the @ARRAY line is: |
@ARRAY=<Array size> | Array size is the size of the used array buffer. The @ARRAY line has only effect within the statement is placed. |
@COL and @WCOL | These types of lines define the mapping between the database
fields and the M3 PWB fields. A @COL or @WCOL line consists of six elements
separated by semicolons. The @WCOL is used like the @COL when inside a WHERE clause
in a statement. The syntax of the @COL and @WCOL lines are:
This element contains, in addition to @COL= or @WCOL, the name of the database column in question. You can also state a fixed value.
This element defines the SQL type of the database column.
Defines if one or more PSDB function is used.
This element states the M3 PWB field name. The M3 PWB field name is specified using symbolic names. A symbolic name contains both data type, offset and length information.
If the M3 PWB field is a character field, you can address only a part of the field by specifying a from and a to position within the field. If this element is left blank the whole field is used.
Any comment. These types of lines are used when data is taken from or inserted into M3 PWB. |
@LINKED | A parameter file statement defines one or more commands (SQL
statements) that are sent to the database. The commands can be linked together
within a statement by the @LINKED line. After the first command definition in the
statement, write @LINKED on a line and define the next command. The linked commands are executed sequentially. |
@SKIP | This is used when you want to skip execution of a particular command. |