DB2 graphic  QMF Version 8

Passing a value to a query

To pass values, you use parameters. Parameters are typically used in object property expressions as placeholders for calculated values to be set at runtime.

Suppose you want to create a query that returns customer buying information for each department in a store. However, you want your users to specify the department. You must first create a query that uses a query parameter. The value of the query parameter is based on information passed from the user's choice.

You can provide user choices in various ways: option buttons, a list control, or text instructions that tell the user to click the relevant data point in a related layout. Then, as described in Passing data from user input, you assign an event action to any object the user might choose.

To pass information about the user's choice to a query, you can use a global or scene parameter to supply the value of a QueryParameters object.

Here is an example of how you can specify the value of the QueryParameters object:

Q_dept=G_department

In this expression, G_department is the global parameter for the corporate department, and Q_dept is the query parameter.

This is similar to the example in the section Passing data from user input. In that example, the global parameter was used to create a dynamic chart. The query in that example returned one set of values, and the user input specified which column was used in the data template. In this example, the global parameter changes the query results.


Go to the previous page Go to the next page

Downloads | Library | Support | Support Policy | Terms of use | Feedback
Copyright IBM Corporation 1982,2004 Copyright IBM Corporation 1982, 2004
timestamp Last updated: March, 2004