SET CURRENT LOCALE LC_TIME statement

The SET CURRENT LOCALE LC_TIME statement changes the value of the CURRENT LOCALE LC_TIME special register. It is not under transaction control.

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

Read syntax diagramSkip visual syntax diagramSETCURRENTLOCALELC_TIME =host-variablestring-constant

Description

The CURRENT LOCALE LC_TIME special register is used by the DAYNAME, MONTHNAME, NEXT_DAY, ROUND, ROUND_TIMESTAMP, TIMESTAMP_FORMAT, TRUNCATE, TRUNC_TIMESTAMP and VARCHAR_FORMAT functions when the locale-name argument is not explicitly specified.
host-variable
A variable of type CHAR or VARCHAR. It cannot be set to null.
string-constant
A character string constant.

Notes

  • Initial Value: The initial value of the CURRENT LOCALE LC_TIME special register is 'en_US'.
  • Potential future use: In a future release the value of the CURRENT LOCALE LC_TIME special register might be used by other scalar functions and for other areas of the database environment that involve datetime values.
  • Valid locales and naming: For information about valid locales and their naming, see the Related reference section at the end of this topic.

Examples

  • Example 1: The following statement sets the CURRENT LOCALE LC_TIME special register to the English (Canada) locale using the latest version of Common Locale Data Repository (CLDR) available in the database manager.
    SET CURRENT LOCALE LC_TIME = 'en_CA'
  • Example 2: The following statement sets the CURRENT LOCALE LC_TIME special register to the French (France) locale using Common Locale Data Repository (CLDR) version 1.8.1. The MONTHNAME scalar function is then invoked with a single argument of '2008-11-10-00.00.00.000000'.
    SET CURRENT LOCALE LC_TIME = 'CLDR181_fr_FR'
    VALUES MONTHNAME( '2008-11-10-00.00.00.000000' )
    returns:
    'novembre'