Rules for setting special registers with profile tables
In remote applications, a special register can be referenced with a value from the profile attributes table. In addition to general rules, there are rules specific to using special registers set in profiles.
Changing register values
A rollback operation has no effect on the values of special registers.
SET statements for the following special registers can be specified in DSN_PROFILE_ATTRIBUTES table with the SPECIAL_REGISTER keyword. For detailed instructions, see Setting special registers with profile tables.
CURRENT ACCELERATOR
- CURRENT APPLICATION COMPATIBILITY
- CURRENT DEBUG MODE
- CURRENT DECFLOAT ROUNDING MODE
- CURRENT DEGREE
- CURRENT EXPLAIN MODE
- CURRENT GET_ACCEL_ARCHIVE
- CURRENT FUNCTION PATH
- CURRENT LOCALE LC_CTYPE
- CURRENT MAINTAINED TABLE TYPES
- CURRENT MAINTAINED TABLE TYPES FOR OPTIMIZATION
- CURRENT OPTIMIZATION HINT
- CURRENT PACKAGE PATH
- CURRENT PATH
- CURRENT PRECISION
- CURRENT QUERY ACCELERATION
- CURRENT REFRESH AGE
- CURRENT ROUTINE VERSION
- CURRENT RULES
- CURRENT SCHEMA
- CURRENT SQLID1
- CURRENT TEMPORAL BUSINESS_TIME
- CURRENT TEMPORAL SYSTEM_TIME
- ENCRYPTION PASSWORD
- PATH
- SCHEMA
- SESSION TIME ZONE
- TIME ZONE
The following rules apply for the SET statements for special registers:
- The SET statement must have an equal sign (=) between the special register name and the value that is assigned.
- The maximum length of the SET statement is 1024 bytes.
- The special register names are allowed to be in mixed case. Extraneous blanks between keywords are removed.
- The special register assigned value is stored as specified. The value must be valid for the special register.
- Special register values cannot be expressions, cannot reference other special registers, and cannot reference global variables.
- For CURRENT REFRESH AGE, the value 99999999999999 is not supported. Use the value ANY instead.
- Db2 treats all special register values that are passed through this interface as literal strings. For example, if a specified special register value is the same as the name of a special register, Db2 stores the special register name, and not the special register value.
- The SET statement must be a Unicode string and encoded with the appropriate CCSID for the application.
Special register values that are set through the profile table take precedence over values that are set by the application before the first non-SET SQL statement. For example, values set by a profile override value that are set through a client connection or data source properties when the connection is first established. The special register values persist for the lifetime of the connection unless the application explicitly sets the special register. Special register values that are set explicitly by the application take precedence over values that are set by the profile table facility and values that are set by the client connection and data source properties. System directed connections, such as three-part name references, use the values of the special registers of the requesting Db2 site. For example, if a Java™ application establishes a connection to Db2 site 1, the special register values are established with the profile tables from site 1. Later, if the application runs an SQL statement with an implicit three-part name connection to Db2 site 2, then the special register values that are established on site 1 are referenced when the SQL statement runs on site 2.
Special register values that are set through the profile table facility observe the existing rules for inheritance within a routine as defined by INHERIT SPECIAL REGISTERS or DEFAULT SPECIAL REGISTERS routine options. After a user-defined function or a stored procedure completes, Db2 restores all special registers to the values they had before invocation.
As with other special register behavior, commits and rollbacks do not change special register values regardless of how they were established.
