capturedOnly property

Specifies whether to run only the SQL statements that are in the pureQueryXML file.

You can set this property to TRUE after you create a pureQueryXML file to use with an application. You cannot set it to TRUE when you are capturing SQL statements.

This property can take these values:

TRUE
The application runs only the SQL statements that are in the pureQueryXML file.
FALSE
The application runs all SQL statements, even those that are not in the pureQueryXML file.
This is the default value.
Note: When the capturedOnly property is set to TRUE, SET statements that set special registers or JDBC Connection methods that have the effect of setting special registers, are not restricted by pureQuery Runtime. The statements are always allowed whether or not the statement is in the pureQueryXML file.
If an SQL statement is run with optimistic locking, the statement cannot be run statically. Consequently, pureQuery Runtime does not capture statements that are run with optimistic locking. The statements are not affected by the pureQuery Runtime options allowDynamicSQL or capturedOnly. Optimistic locking is enabled by the following methods:

DB2Connection.prepareDB2OptimisticLockingQuery
DB2Statement.executeDB2OptimisticLockingQuery

The following table shows the capturedOnly, executionMode and allowDynamicSQL combinations and resulting operations:

Table 1. capturedOnly, executionMode, and allowDynamicSQL combinations and resulting operations:
capturedOnly executionMode allowDynamicSQL SQL statement matched Result
TRUE STATIC TRUE YES isBindable = True, Run the SQL statement statically

isBindable = False, Run the SQL statement dynamically

TRUE STATIC/DYNAMIC TRUE/FALSE NO Return an error
TRUE STATIC FALSE YES isBindable = True, Run the SQL statement statically

isBindable = False, Return an error

TRUE DYNAMIC TRUE/FALSE YES Run the SQL statement
FALSE STATIC TRUE YES isBindable = True, Run the SQL statement statically.

isBindable = False, Run the SQL statement dynamically

FALSE STATIC TRUE NO Run the SQL statement dynamically
FALSE STATIC FALSE YES isBindable = True, Run the SQL statement statically.

isBindable = False, Return an error

FALSE STATIC FALSE NO Return an error
FALSE DYNAMIC TRUE/FALSE YES/NO Run the SQL statement

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
capturedOnly = TRUE | FALSE
IBM Data Server Driver configuration syntax
< parameter name="capturedOnly" value="TRUE | FALSE" />
Equivalent IBM Data Server Provider for .NET connection string keyword
capturedOnly=TRUE | FALSE

Usage notes

When the keyword capturedOnly=TRUE is set for a CLI or .NET application that is enabled with pureQuery client optimization, statements with the statementType SET_METHOD are restricted by pureQuery Runtime if the statement is not in the pureQueryXML file.


Feedback