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.

NoteHow 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.

For the case of the array defined as deptarray, the expression in the Where view will look like the following expression. You can paste the :deptarray argument using the pop-up menus in the value area of the Where view:

The sample shows the Table layout view. Within D B A dot employee, four columns are selected. At the bottom  the Where view is open. The column  is displayed as " D B A " dot " employee " dot " dept _ i d " , the Operator as in, and the Value as : dept array.

Supplying values for an array argument

When you preview the report, you are prompted to supply the department values. InfoMaker retrieves rows that match one of the set of values that you supply. For example, if you supply the department IDs 100, 200, and 500 as shown, your report displays information about these departments:

Shown is the Specirfy Retrieval Arguments dialog box. For the Argument, the position is shown as 1, the Name as dept array, the Type as Number Array, and the Value as 100 comma 200 comma 500.