Row Parameters
??<field name>
...or...
??^<field usage id>
A row parameter takes information from a row of data and plugs it into a statement. A row parameter is indicated
by two question marks followed by a database column name. For example, if a database record describing a single
employee has been selected from the EMPLOYEES table, and now information about that employee's department
needs to be selected from the DEPARTMENT table, the SQL statement might look something like this:
SELECT * FROM PJDATA.DEPARTMENT WHERE ID = ??DEPT_ID
This statement assumes that ID is the key in the DEPARTMENT table, and that the "current row"
(from the EMPLOYEE table) contains a column called DEPT_ID which is a foreign key to the DEPARTMENT table.
When this statement is run, the value of the DEPT_ID field of the "current" row is used as the parameter value.
NOTE: Parameters that start with two or more question marks, such as the above, are automatically filled in by WOW;
the user is not shown any type of prompt.
User Parameters
???<field name>
A user parameter is similar to a row parameter, except instead of taking information from the "current" row,
the information is taken from a row of data associated with the current application user. A user parameter
is identified by three question marks in a row followed by a database column name. So, the following statement:
SELECT * FROM PLANETJ.CUSTOMER WHERE ID = ???CLIENT_ID
...will select rows where the ID field is equal to the CLIENT_ID field associated with the current user.
There is a special user parameter called USERID which is always associated with the id that was used to sign onto
the application. This user parameter can be used with any type of application sign-on (except for an unsecured sign-on,
which does not require the user to enter a user id or password). The SQL statement:
SELECT * FROM PLANETJ.USER_INFO WHERE ID = ???USERID
...would select every row from the USER_INFO table where the ID column has a value equal to the user ID of the
current user. User ID’s are always converted to uppercase, so in the above example all values in the ID column
should be uppercase as well.
Global Variables as Parameters
??!<field name>
WOW has the ability to remember certain fields marked as global and make them available later to other operations.
Other operations may reference these global variables by using “??!” followed by the field name. See Global Variables for more information.
SELECT * FROM PLANETJ.CUSTOMER WHERE ID = ??!CUSTOMER_ID
Usage ID Parameters
???^<field usage id>
In order to use a row or user parameter, you have to know the database column name of the field whose value you
are interested in. In some cases this is not possible - usually this happens when multiple tables contain the same
logical piece of information in different fields. In this situation, you can identify the field to use by its usage ID instead
of its column name. A usage ID is an integer you can associate with one or more field descriptors. A usage ID
parameter will look for a field descriptor with the specified usage ID in the row (either the user row or the current row)
and use the value in the field described by that field descriptor.
A user usage ID parameter is denoted by three question marks followed by a caret and the usage ID. The statement:
SELECT * FROM PLANETJ.CUSTOMER WHERE ID = ???^18
...would take the value associated with usage ID 18 in the user row as the parameter value.
A row usage ID parameter is denoted by two question marks followed by a caret and the usage ID.
SELECT * FROM PLANETJ.CUSTOMER WHERE ID = ??^46
...would take the value associated with usage ID 46 in the current row as the parameter value.