CONNX Data Integration Suite 14.8.0 | InfoNaut - The Query Tool | Working with Queries | Adding parameters to a query
 
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:The query we will use for our example is SELECT * FROM <%Enter table name%> where EmployeeID=<%Enter EmployeeID|4%>
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 (Execute button.) 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.In our example the results pane only has results from the table Orders that have EmployeeID value of 4.
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.