SET CURRENT APPLICATION ENCODING SCHEME

The SET CURRENT APPLICATION ENCODING SCHEME statement assigns a value to the CURRENT APPLICATION ENCODING SCHEME special register. This special register allows users to control which encoding scheme will be used for dynamic SQL statements after the SET statement has been executed.

Invocation for SET CURRENT APPLICATION ENCODING SCHEME

This statement can be embedded only in an application program. It is an executable statement that cannot be dynamically prepared.

Authorization for SET CURRENT APPLICATION ENCODING SCHEME

None required.

Syntax for SET CURRENT APPLICATION ENCODING SCHEME

Read syntax diagramSkip visual syntax diagramSET CURRENTAPPLICATIONENCODING SCHEME=string-constanthost-variable

Description for SET CURRENT APPLICATION ENCODING SCHEME

string-constant
A character string constant that represents a valid encoding scheme (ASCII, EBCDIC, UNICODE, or a character representation of a number in the range 1–65533).
host variable
A variable with a data type of CHAR or VARCHAR. The value of host-variable must not be null and must represent a valid encoding scheme or a character representation of a number in the range 1–65533). An associated indicator variable must not be provided.

The value must:

  • Be left justified within the host variable
  • Be padded on the right with blanks if its length is less than that of the host variable

Examples for SET CURRENT APPLICATION ENCODING SCHEME

The following examples set the CURRENT APPLICATION ENCODING SCHEME special register to 'EBCDIC' (in the second example, Host variable HV1 = 'EBCDIC').
  EXEC SQL SET CURRENT APPLICATION ENCODING SCHEME = 'EBCDIC';
  EXEC SQL SET CURRENT ENCODING SCHEME  = :HV1;