>>-MONTHNAME--(--expression--+----------------+--)-------------><
'-,--locale-name-'
The schema is SYSIBM. The SYSFUN version of the MONTHNAME function
continues to be available.
The MONTHNAME function returns
a character string containing the name of the month (for example,
January) for the month portion of expression,
based on locale-name or the value of the
special register CURRENT LOCALE LC_TIME.
- expression
- An expression that
returns a value of one of the following built-in data types: a DATE,
TIMESTAMP, or a valid character string representation of a date or
timestamp that is not a CLOB. In a Unicode database, if a supplied
argument is a graphic string, it is first converted to a character
string before the function is executed.
- locale-name
- A character constant that specifies the locale used to determine
the language of the result. The value of locale-name is
not case-sensitive and must be a valid locale (SQLSTATE 42815). For
information on valid locales and their naming, see "Locale names for
SQL and XQuery". If locale-name is not specified,
the value of the special register CURRENT LOCALE LC_TIME is used.
The result is a varying-length character string. The length
attribute is 100. If the resulting string exceeds the length attribute
of the result, the result will be truncated. If the expression argument
can be null, the result can be null; if the expression argument
is null, the result is the null value. The code page of the result
is the code page of the section.
Notes
- Julian and Gregorian calendar: The transition
from the Julian calendar to the Gregorian calendar on 15 October 1582
is taken into account by this function. However, the SYSFUN version
of the MONTHNAME function assumes the Gregorian calendar for all calculations.
- Determinism: MONTHNAME is a deterministic
function. However, when locale-name is not
explicitly specified, the invocation of the function depends on the
value of the special register CURRENT LOCALE LC_TIME. This invocation
that depends on the value of a special register cannot be used wherever
special registers cannot be used (SQLSTATE 42621 or 428EC ).
Example
- Assume that the variable TMSTAMP is defined
as TIMESTAMP and has the following value: 2007-03-09-14.07.38.123456.
The following examples show several invocations of the function and
the resulting string values. The result type in each case is VARCHAR(100).
Function invocation Result
-------------------------- ----------
MONTHNAME (TMSTAMP, 'CLDR 1.5:en_US') March
MONTHNAME (TSMTAMP, 'CLDR 1.5:de_DE') Marz
MONTHNAME (TMSTAMP, 'CLDR 1.5:fr_FR') mars