8.8.2 UPPER
Converts character string data from lowercase (a to z) to uppercase (A to Z). Single- and double-byte letters are supported.
- Organization of this subsection
(1) Specification format
scalar-function-UPPER ::= UPPER(character-string-data-to-convert) character-string-data-to-convert ::= value-expression
(2) Explanation of specification format
- character-string-data-to-convert:
-
Specifies the character string data to convert.
The following rules apply:
-
Specify character-string-data-to-convert in the form of a value expression. For details about value expressions, see 7.20 Value expression.
-
Specify CHAR or VARCHAR type data for character-string-data-to-convert.
-
You cannot specify a dynamic parameter by itself for character-string-data-to-convert.
The following table shows the character encodings and character ranges that are converted.
Table 8‒24: Character encodings and character ranges that are converted by the scalar function UPPER Character encoding
Range of characters to be converted
Range of characters post-conversion
Single-byte/double-byte
Unicode (UTF-8)
a (0x61) to z (0x7a)
A (0x41) to Z (0x5a)
Single-byte characters
(0xefbd81) to (0xefbd9a)
(0xefbca1) to (0xefbcba)
Double-byte characters
Shift-JIS
a (0x61) to z (0x7a)
A (0x41) to Z (0x5a)
Single-byte characters
(0x8281) to (0x829a)
(0x8260) to (0x8279)
Double-byte characters
-
The following example illustrates the result of executing the scalar function UPPER.
- Example
-
Convert the lowercase letters in the character string aBc123XyZ to uppercase.
UPPER('aBc123XyZ') → 'ABC123XYZ'
(3) Rules
-
The length of the data type of character-string-data-to-convert becomes the length of the data type of the execution result.
-
The NOT NULL constraint does not apply to the value of the execution result (the null value is allowed).
-
If character-string-data-to-convert has the null value, the execution result will be a null value.
(4) Example
- Example:
-
Convert the data in the NAME column of the employee table (EMPLIST) to all uppercase.
SELECT "USERID",UPPER("NAME") FROM "EMPLIST"