Name

LOWER

Synopsis

The LOWERfunction converts all letters in the specified string to lowercase. The specifications for the LOWER function are:

FUNCTION LOWER (string1 IN CHAR) RETURN CHAR
FUNCTION LOWER (string1 IN VARCHAR2) RETURN VARCHAR2

As noted earlier, LOWER and UPPER return a fixed-length string if the incoming string is fixed-length. LOWER will not change any characters in the string that are not letters, as case is irrelevant for numbers and special characters.

Here are some examples of the effect of LOWER:

LOWER ('BIG FAT LETTERS') --> 'big fat letters'
LOWER ('123ABC') --> '123abc'

LOWER and UPPER are useful for guaranteeing a consistent case when comparing strings. PL/SQL is not a case-sensitive language with regard to its own syntax and names of identifiers, but it is sensitive to case in character strings, whether they are found in named constants, literals, or variables. The string “ABC” is not the same as “abc”, and this can cause problems in your programs if you are not careful and consistent in your handling of such values.

Get Oracle PL/SQL Programming, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.