enableDynamicSQLReplacement property

Specifies whether to run alternative SQL statements in a pureQueryXML file, where neither those alternative statements nor the corresponding original statements were bound by the StaticBinder utility.

After you capture SQL statements in a pureQueryXML file, you might discover that one or more statements do not perform as well as your application requires. However, because you discover this fact late in your development cycle, modifying the application might not be possible. You can edit the pureQueryXML file by adding an alternative SQL statement for each SQL statement that is underperforming. When you run your application, pureQuery uses the alternative SQL statements, instead of the SQL statements that you originally captured.

You can choose whether to bind the alternative SQL statements after you add them. If you do not bind them but want to use them, you must set the enableDynamicSQLReplacement property to TRUE when you run your application.

  • If an SQL statement contains named parameter markers, the alternative statement must have the same number of parameter markers and those markers must be in the same order.
  • The alternate SQL statement must replace a statement that performs a similar action. For example, the result set for an alternate SELECT statement must match the result set for the original SELECT statement.
  • The alternate SQL statement cannot be a different type of statement. For example, the alternate statement for a SELECT statement cannot be a procedure call even if the procedure call performs a similar action.

This property can take these values:

Specifies to run the alternative SQL statements. pureQuery runs them dynamically because they are not bound.
Specifies not to run the alternative SQL statements. Instead, pureQuery runs the original SQL statements that are in the pureQueryXML files that your application uses.
This is the default value.
The following list describes whether pureQuery Runtime runs an alternative SQL statement:
  • If the value of executionMode is DYNAMIC, the SQL statement that is run depends on the value of the enableDynamicSQLReplacement property.
  • If the value of executionMode is STATIC:
    • If the alternative statement is not bound, it is run only when both the value of the enableDynamicSQLReplacement option is TRUE and the value of the isBindable attribute is FALSE for the original statement.
    • If the alternative SQL statement is bound, the alternative statement is run statically. The enableDynamicSQLReplacement property is ignored.

      To bind the alternative statement, add the alternative statement and then perform the bind operation. If the original statement is marked as bindable, the alternative statement is bound.

DB2 CLI and IBM Data Server Driver usage notes

When using DB2® Call Level Interface (CLI) or the IBM® Data Server Driver with pureQuery Runtime, you can use the pureQuery Runtime property as a configuration keyword.

IBM CLI keyword syntax
enableDynamicSQLReplacement = TRUE | FALSE
IBM Data Server Driver configuration syntax
<parameter name="enableDynamicSQLReplacement" value="TRUE | FALSE" />
Equivalent IBM Data Server Provider for .NET connection string keyword
enableDynamicSQLReplacement=TRUE | FALSE