Previous Topic Next topic Print topic


SET CURRENT LOCALE LC_CTYPE

The SET CURRENT LOCALE LC_CTYPE statement assigns a value to the CURRENT LOCALE LC_CTYPE special register. The special register allows control over the LC_CTYPE locale for statements that use a function that refers to a locale, such as LCASE, UCASE, and TRANSLATE (with a single argument).
Restriction: This topic applies to Windows environments only.

This command is supported only syntactically by the XDB Server.

Invocation

This statement can be embedded in an application program or issued interactively. It is an executable statement that can be dynamically prepared.

Authorization

None required.

Syntax

SET {[CURRENT [LOCALE]] LC_CTYPE | CURRENT_LC_CTYPE} 
    [=]
    {string-constant | host-variable}

Description

The value of CURRENT LOCALE LC_CTYPE is replaced by the string constant or host variable specified. The value must be a CHAR or VARCHAR character string that is no longer than 50 bytes.

If a host variable is specified, its value must not be null. If it has an associated indicator, the value of the indicator value must not indicate a null value. The locale 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

The value of CURRENT LOCALE LC_CTYPE is replaced by the value specified. The value must not be longer than 50 bytes and must be a valid locale.

string-constant

A character string constant that must not be longer than 50 bytes and must represent a valid locale.

host-variable

A variable with a data type of CHAR or VARCHAR and a length that is not longer than 50 bytes. The value of host-variable must not be null and must represent a valid locale. If the host variable has an associated indicator variable, the value of the indicator variable must not indicate a null value.

The locale 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

A locale can be specified in uppercase characters, lowercase characters, or a combination of the two.

Some examples of locales include:

  • Fr_BE
  • Fr_FR@EURO
  • En_US
  • Ja_JP

Example:

Set the CURRENT LOCALE LC_CTYPE special register to the locale 'En_US'.

EXEC SQL SET CURRENT LOCALE LC_CTYPE = 'En_US';
Previous Topic Next topic Print topic