Specifications
Using SQL Select
174 InfoMaker
3 Enter a name and datatype for each argument.
The first character must be alphabetic (a–z); subsequent characters can be
alphanumeric (a–z, 1–9), an underscore ( _ ), or a dollar sign ($).
4 Click the Add button to define additional arguments as needed, and click
OK when done.
Specifying an array as
a retrieval argument
You can specify an array of values as your retrieval argument. For example,
suppose you want a report that shows employee names and IDs for a few
departments and prompts you to enter the IDs when you preview the report.
In the Specify Retrieval Arguments dialog box, choose the type of array from
the Type drop-down list. For the case of department IDs, the array is a number
array.
Referencing retrieval arguments
After you define retrieval arguments, you must reference the arguments in the
Where view or Having view in the Select painter.
To reference an argument means to refer to the argument in an expression so
that InfoMaker can use it as a placeholder until you provide the actual value.
For example, if a report is retrieving all rows from the Department table where
the
DeptID matches a value provided, the WHERE clause looks something like
this:
WHERE DeptID = :Entered_id
where Entered_id was defined previously as a retrieval argument in the Specify
Retrieval Arguments dialog box.
How retrieval arguments are referenced
In SQL statements, variables (called host variables) are always prefaced with
a colon to distinguish them from column names.
A retrieval argument is a variable. To reference the retrieval argument
Entered_id in a SQL statement, enter:
:Entered_id
Referencing an array
To reference an array, use the IN operator and reference the retrieval argument
in the
WHERE or HAVING clause.