Adding parameters to a query
A parameterized query is a query that contains variables, also known as parameters, whose values can vary at run time. The parameters replace literal values in an SQL statement.
To add a parameter to a query:
1. Create a query in the main InfoNaut query pane.
We will use the query in the following image as an example:
Note:
If you create the query anywhere besides the main InfoNaut query pane (for example in the Recent Queries box), the query will not be executed.
2. Substitute the literal value for the table name. In this example this is the parameterized marker <%Enter table name%>.
3. To replace a literal column name in a WHERE statement, you have to replace the column name with the parameterized marker <%Enter EmployeeID|4%>. The pipe symbol ( |) sets in this case the default EmployeeID to 4.
4. Click the Execute () button.
5. Enter the name of the table in the newly opened InfoNaut - Input dialog box that asks for it, and click the OK button. In this example, the value will be Orders.
6. Enter the Employee ID value in the newly opened InfoNaut - Input dialog box that asks for it, and click the OK button. In this example the value will be 4.
The query executes and returns only the records in which EmployeeID = "4" in the lower pane.
The parameterized query appears in the upper pane. The values you entered have replaced the parameterized marker. The original parameterized query is included in the Recent Queries list box.