SQL LCASE_LOWER scalar function in DB2 for i SQL |
LOWER or LCASE
The LOWER/LCASE function returns string where all the characters get converted in lowercase. LCASE is a synonym for LOWER. We should use LOWER as per the SQL standards.
LOWER Syntax
LOWER(string-expression, locale-name-string<optional>,<integer>)
LCASE Syntax
LCASE(string-expression, locale-name-string<optional>,<integer>)
String-expression can be either character or graphic string. If graphic, then locale-name-string must be specified, if its a bit data, then locale-name-string should not be specified. We can also pass numeric data type value to this function as it is implicitly cast to a VARCHAR data type.
locale-name-string can be Fr_BE(French_Belgium) , En_US(English_United States), Ja_JP(Japenese_Japan) etc. Here, Locale specifies the name of Language-Territory.
Integer value is the length of the return value.
Example
SELECT lower('TEST') , lcase('Test'), lower('test'), lcase(1) FROM sysibm.SYSDUMMY1
Output
LOWER ( 'TEST' ) LCASE ( 'Test' ) LOWER ( 'test' ) LCASE ( 1 ) test test test 1