To add 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.

1. Create a query in the main InfoNaut query pane.

Query_window.bmp

Note
: If you create the query anywhere besides the main InfoNaut query pane (such as the Recent Queries box), the query will not be executed

 

2. Substitute the literal value for the table name, in this example, the parameterized marker <%Enter table name%>.

3. To replace a literal column name in a WHERE statement (in this case, EmployeeID) substitute the column name with the parameterized marker <%Enter EmployeeID|4%>. The pipe between "EmployeeID" and "4" in the parameter sets the default Employee ID to 4.

4. Click Execute.

Execute_button.bmp

5. The Input dialog box appears.

Enter_table_name.bmp
 

Enter the name of the table, and then click the OK button.

 

Enter_table_name_with_data.bmp

 

6. The Enter Parameter dialog box appears. Enter the Employee ID, and then click OK.

Enter_Parameter.bmp
 

7. The query results, containing only those records for EmployeeID = "4" appear in the lower pane.

 

Query_parameter_executed.bmp

 

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.