Adding a Parameter to a SELECT Clause
When you want parameters to be used in a SELECT clause, you must add them from cells in the Column column.
To include a parameter in the SELECT clause of a parameterized query
|
1.
|
Right-click a location in the resource tree and select New Parameterized Query. |
|
2.
|
In the Input window, supply a unique name for the parameterized query, and click OK. |
The editor for building the query appears.
|
3.
|
Add the resources to the Model panel. |
You can add any type of table (relational, LDAP, delimited file) and a procedure that contains scalar outputs or one cursor output.
See Adding a Resource to the Model Panel for details.
|
5.
|
In the Grid panel, which works like the Grid panel in the view editor, click the first Column cell and select a column. |
|
6.
|
Right-click the next Column cell and select Parameter. |
|
7.
|
In the Add Parameter dialog, type a name in the Parameter Name field, and select a data type. |
This entry now appears in the Column cell.
|
8.
|
Click the name in the Alias cell and rename it if you want. |
|
9.
|
Click the SQL Script tab if you want to view the auto-generated SQL script. |
|
—
|
The parameterized query is treated as a PROCEDURE in the SQL script. |
|
—
|
The parameter defined in a previous step appears as an input parameter of the procedure, and is also included in the SELECT clause of the parameterized query. |
|
—
|
The output of the parameterized query is rendered as a CURSOR-type OUT parameter of the procedure. |
|
10.
|
Click the Parameters tab if you want to view how the parameters are displayed. |
|
11.
|
Save the parameterized query. |