SET CURRENT APPLICATION COMPATIBILITY
The SET CURRENT APPLICATION COMPATIBILITY statement assigns a value to the CURRENT APPLICATION COMPATIBILITY special register. This special register allows users to control the package compatibility level behavior for dynamic SQL.
Invocation
This statement can be embedded in an application program or dynamically
prepared.
Authorization
None required.
Syntax
Description
- string-constant
- Specifies a character string constant. The value must represent a valid release compatibility level, in uppercase.
- variable
- A variable with a
data type of CHAR or VARCHAR. The value of variable must not be null and must
represent a valid release compatibility level, in uppercase.
The value must:
- Be left-aligned within the variable
- Be padded on the right with blanks if its length is less than the variable
The following levels can be specified to set to specify the compatibility behavior of dynamic SQL statements in packages:
- V11R1
- Specifies Db2 11 application compatibility behavior. This value is supported only in Db2 11 new-function mode.
- V10R1
- Specifies Db2 10 compatibility behavior.
Examples
The following examples set the CURRENT
APPLICATION COMPATIBILITY special register to 'V10R1' (in the second example, host
variable HV1 = 'V10R1').
EXEC SQL SET CURRENT APPLICATION COMPATIBILITY = 'V10R1';
EXEC SQL SET CURRENT APPLICATION COMPATIBILITY = :HV1;
