Parameters
There are many cases where the statement you want to run cannot be completely specified at design time.
This usually happens when the statement contains certain values that either needs to be directly inputted
by the user at run-time or depend on the context in which the statement is being run (the context includes
things such as the user's sign on information and previous statements that the user has run). WOW handles
these cases by using default parameters. A parameter is represented in code by one or more question
marks, possibly followed by additional parameter control characters. For example, the following SQL
statement contains 3 different parameters:
SELECT * FROM PLANETJ.CUSTOMER WHERE (BALANCE > ? AND ID = ???CUSNUM) OR ??1 < 0
...or...
??!WOW_APP_ID
Current Application and Operation parameters which get their value from current Application and Operation id.
??+<key>
ExecutingContext Parameter is similar to the request attribute. An ExecutingContext is created with each request that comes into WOW and exists for the duration of the request.
??*<request attribute key>
Request Attribute is different from the Request Parameter mentioned above.
SQL Replacement Text Parameters:
??<column_name
Replacement Text parameter replaces a specified column being used and replaces it with a portion of SQL being specified. This happens at runtime then renders the results.
??>FULL_CLASS_NAME\METHOD_NAME\METHOD_PARAM1\METHOD_PARAM2
[PRO] A class parameter allows an operation to call off to a specified Java method.
At run-time the parameter is replaced by the results of the method.
??>GlobalAttr|setGlobalAttribute|accountNumber|123
[Minimum WOW 7.02] The following code (above) can be inserted into an Operation's title or instructions or an HTML Code Operation.
SQL_Code...WHERE some_field <condition> ?
Normally when user needs to fill in a parameter’s value, that parameter will default to a blank value.
For example, if your query is:
SELECT * FROM PJDATA.CUSTOMER WHERE BALANCE > ?
TAGS: User prompts
??!WOW_OP_ID
WOW supports the ability to store metadata in any number of user libraries or schema's.
The default is "PJUSERxx" where "xx" is the release id.
WOW Release 7.0 example
PJUSER70
??!<RowCollection>
RowCollection parameters are parameters which get their values from the current RowCollection
(1 or more Rows displayed by an Operation). RowCollection parameters can be used to show
attributes of the current rowcollection in your operation results, such as in the operation title or
instructions.
<library name>release_id
Session parameters are a more advanced parameter type and are only really used when doing custom programming.
Two question marks followed by a semi-colon “;” and a key name is the sequence used to indicate a Session parameter.
??;<session attribute key>
Request parameters are parameters which get their values from the HttpRequest.
Two question marks followed by a percent sign “%” and an identifying name is the sequence
used to indicate a Request parameter.
??%<parameter name>
Runtime parameters are parameters which are specified when the user first enters an application, and can then
apply to all operations executed by that user.
Two question marks followed by a colon “:” and an identifying name is the sequence used to indicate a runtime
parameter.
??:<key>
A single question mark in an SQL statement represents a SQL prompt parameter.
Field Descriptor Prompt Parameters:
?xyz
For complex SQL, you should explicitly identify the FD is to use for prompting using the syntax: where xyz is the ID of the field descriptor.
??<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.
???<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.
Global Variables as Parameters:
??!<key>
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.
???^<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. A usage ID is an integer you can associate with one or more field descriptors.
A user usage ID parameter is denoted by three question marks followed by a caret and the usage ID.
?~<table name>
A table parameter is used when you want to allow the user to specify the table or tables to run an SQL statement
against. A table parameter begins with a question mark followed a tilde (~) and includes the name of a table;
??<parameter number>
A Parameter parameter is a parameter which gets its value from another parameter in the same statement.
Parameter parameters are used when multiple parameters in a statement must all have the same value.
In general, a Parameter parameter is denoted by two question marks followed by a number.
??&<parameter number>
A Context Parameter parameter is a parameter that is similar to a Parameter parameter, but rather than
getting its value from another parameter in the same statement, it gets it’s value from a parameter (search)
in an associated statement.
In general, a Context Parameter parameter is denoted by two question marks followed by an ampersand ('&')
and a number.
?
The ?, ???CUSNUM, and ??1 all serve as placeholders for values that are not known at design time, but will be
plugged in to the statement at run-time before it is executed. This section will describe the various parameter
types that are available in WOW and how to use them.
Parameter Types and Definitions
Note: The following Parameters have brief definitions under each type. Click on the Parameter name
and it will take you to the page where it is defined in greater detail.