DeferredPrepare CLI/ODBC and IBM data server driver configuration keyword
Minimizes network flow by combining the PREPARE request with the corresponding execute request.
- db2cli.ini keyword syntax:
- DeferredPrepare = 0 | 1
- IBM data server driver configuration file (db2dsdriver.cfg) syntax:
- <parameter name="DeferredPrepare" value="0 | 1"/>
Attention: The IBM data server
driver configuration
file (db2dsdriver.cfg) syntax is available in Db2 11.5.4 and later.
- Default setting:
- The prepare request will be delayed until the execute request is sent.
- Equivalent statement attribute:
- SQL_ATTR_DEFERRED_PREPARE
- Usage notes:
Defers sending the PREPARE request until the corresponding execute request is issued. The two requests are then combined into one command/reply flow (instead of two) to minimize network flow and to improve performance.
- 0 = SQL_DEFERRED_PREPARE_OFF. The PREPARE request will be executed the moment it is issued.
- 1 = SQL_DEFERRED_PREPARE_ON (default). Defer the execution of
the PREPARE request until the corresponding execute request is issued.
If the target DBMS does not support deferred prepare, the client disables deferred prepare for that connection.
Note: When deferred prepare is enabled, the row and cost
estimates normally returned in the SQLERRD(3) and SQLERRD(4) of the
SQLCA of a PREPARE statement may become zeros. This may be of concern
to users who want to use these values to decide whether or not to
continue the SQL statement.