AIX | HP-UX | Linux | OS/2 | OS/390 | OS/400 | PTX | SUN | Win NT |
X | X | X | X |
|
| X | X | X |
Purpose
Specifies that Net.Data should take advantage of DB2's prepare cache feature. Net.Data does this by substituting Net.Data variables in an SQL statement with parameter markers, and then binding the statement before passing it to DB2 for processing. If DB2 is set up for prepare cache and if the statement has been previously executed, using the same values in the Net.Data variables, DB2 can take advantage of the cached information. This feature will boost performance on SQL queries that are called repeatedly and that have many SQL query values that remain the same.
Restrictions:
Values
DTW_USE_DB2_PREPARE_CACHE="YES"|"NO"
Table 16. DTW_USE_DB2_PREPARE_CACHE Values
Values | Description |
---|---|
YES | Specifies that variable references and DB2 parameters should be substituted with parameter markers. |
NO | Specifies that no parameter markers will be used; the statement will not be changed. This is the default. |
Examples
Example 1: Parameter marker in where clause.
%DEFINE DTW_USE_DB2_PREPARE_CACHE="YES" ... %FUNCTION (DTW_SQL) myfunc() { select id,projname,due from projects where month in '$(m)' and year in '$(y)' %}
The resulting statement to DB2 would be:
select id,projname,due from projects where month in ? and year in ?