DB2 Scalar functions - UPPER (locale sensitive)
The UPPER function returns a string in which all characters have been converted to uppercase characters using the rules associated with the specified locale.
The schema is SYSIBM.
Locale names for SQL and XQuery
CODEUNITS16 specifies that code-units is expressed in 16-bit UTF-16 code units. CODEUNITS32 specifies that code-units is expressed in 32-bit UTF-32 code units. OCTETS specifies that code-units is expressed in bytes.
If a string unit is not explicitly specified, the string unit of string-expression determines the unit that is used. For more information about CODEUNITS16, CODEUNITS32, and OCTETS, see String units in built-in functions in Character strings.
String units in built-in functions
Character strings
The result of the function is VARCHAR if string-expression is CHAR or VARCHAR, and VARGRAPHIC if string-expression is GRAPHIC or VARGRAPHIC. The string units of the result is the same as the string units of string-expression
The length attribute of the result is determined by the implicit or explicit value of code-units, the implicit or explicit string unit, the result data type, and the result string units, as shown in the following table:
The actual length of the result might be greater than the length of string-expression. If the actual length of the result is greater than the length attribute of the result, an error is returned (SQLSTATE 42815). If the number of code units in the result exceeds the value of code-units, an error is returned (SQLSTATE 42815).
If string-expression is not in UTF-16, this function performs code page conversion of string-expression to UTF-16, and of the result from UTF-16 to the code page of string-expression. If either code page conversion results in at least one substitution character, the result includes the substitution character, a warning is returned (SQLSTATE 01517), and the warning flag SQLWARN8 in the SQLCA is set to 'W'.
If the first argument can be null, the result can be null; if the first argument is null, the result is the null value.
SELECT UPPER(JOB , 'en_US') FROM EMPLOYEE WHERE EMPNO = '000020'
VALUES UPPER('IIii', 'tr_TR', CODEUNITS16)
VALUES UPPER('ß', 'de', 2, CODEUNITS16)