8.8.1 LOWER
Converts character string data from uppercase (A to Z) to lowercase (a to z). Single- and double-byte letters are supported.
- Organization of this subsection
(1) Specification format
scalar-function-LOWER ::= LOWER(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‒23: Character encodings and character ranges that are converted by the scalar function LOWER Character encoding
Range of characters to be converted
Range of characters post-conversion
Single-byte/double-byte
Unicode (UTF-8)
A (0x41) to Z (0x5a)
a (0x61) to z (0x7a)
Single-byte characters
(0xefbca1) to (0xefbcba)
(0xefbd81) to (0xefbd9a)
Double-byte characters
Shift-JIS
A (0x41) to Z (0x5a)
a (0x61) to z (0x7a)
Single-byte characters
(0x8260) to (0x8279)
(0x8281) to (0x829a)
Double-byte characters
-
The following example illustrates the result of executing the scalar function LOWER.
- Example
-
Convert the uppercase letters in the character string aBc123XyZ to lowercase.
LOWER('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 lowercase.
SELECT "USERID",LOWER("NAME") FROM "EMPLIST"