Figure 3-40 Query Parameter Child Object
The values contained in the object are used to set the properties of the query at runtime before the query is executed. If the query is not parameterized, the QueryParameter child object is not displayed in the Object Inspector.
Inserting Query Parameters Use the Query Parameter dialog box to insert and define query parameters. You access the Query Parameter dialog box in one of the following ways:
To insert a query parameter using the Query Diagram view
1. Choose Insert Data Source to display the New Data Source dialog box.
2. Select Query Diagram View from the list box and click OK to display the Query Editor.
3. Double-click the Table, Parameter, Filter, and Output blocks to place them in the Query Diagram view.
4. Click the Input and Output ports to connect the query blocks.
5. Right-click the Parameter block and select Properties to display the Query Parameter dialog box.
Figure 3-41 Defining a Query Parameter
6. Type a parameter name in the Parameter name text box.
7. Select a data type from the Data type list box. The data type is used to cast the value of the parameter in the SQL query before it is submitted to the database.
8. Optionally, provide a short description of the parameter.
9. Check the Has default value check box and type the default value of the column in the text box. If you do not provide the default value, the results cannot be viewed in the data sheet.
10. Click OK.
11. Define the remaining query block properties. For detailed instructions on creating queries using the Query Diagram view, see "What Are Data Sources?".
12. Click SQL Text to view the generated SQL text.
13. Click Data Sheet to view the results of your query.
1. Click the Worlds tab and click Data Sources to display the Data Sources panel.
2. Navigate to the query in which you want to modify the query parameter.
3. Expand the Parameters folder.
4. Right-click the query parameter and select Properties to display the Query Parameter dialog box.
5. Modify the parameter properties and click OK.