Bind Variables Value Setting (if Used)

For the named query statement, set values for bind variables (if any are used in the query definition) before executing them. This sequence is required.

The functions need not be executed right after each other, however. For example, the Query.Statement.open() function could be in a startup rule function and the Query.Statement.setvar() function could be in a rule function called on assertion of an event, followed by the Query.Statement.execute() function.

Note: Open a named query statement for each set of variable values that are used at execution time. For example, if you set the variable values two different ways, you would provide two open query statements, each with its own name, to keep the configured queries and their returned information separate from each other

The syntax of the function is:

Query.Statement.setVar(String StatementName, String BindVariableName, Object Value);

For example,

Query.Statement.setVar(S_Id, "min", evt.min_total_sales);

See Bind Variables in Query Text for more details.