Caché SQL Reference
LCASE
[Back] [Next]
   
Server:docs2
Instance:LATEST
User:UnknownUser
 
-
Go to:
Search:    

A case-transformation function that converts all uppercase letters in a string to lowercase letters.
Synopsis
LCASE(string-expression)
{fn LCASE(string-expression)}
Arguments
string-expression The string expression whose characters are to be converted to lowercase. The expression can be the name of a column, a string literal, or the result of another scalar function, where the underlying data type can be represented as any character type (such as CHAR or VARCHAR).
Description
LCASE converts uppercase letters to lowercase. It has no effects on non-alphabetic characters. It leaves unchanged punctuation and leading and trailing blank spaces.
LCASE does not force numerics to be interpreted as a string. Caché SQL converts numerics to canonical form, removing leading and trailing zeros. Caché SQL does not convert numeric strings to canonical form.
The LOWER function can also be used convert uppercase letters to lowercase.
The %SQLUPPER function is the preferred way in SQL to convert a data value for not case-sensitive collation. Refer to %SQLUPPER for further information on case transformation for collation.
Examples
The following example returns each person’s name in lowercase letters:
SELECT TOP 10 Name,{fn LCASE(Name)} AS LowName
     FROM Sample.Person
 
LCASE also works on Unicode (non-ASCII) alphabetic characters, as shown in the following Embedded SQL example, which converts Greek letters from uppercase to lowercase:
  IF $SYSTEM.Version.IsUnicode() {
     SET a=$CHAR(920,913,923,913,931,931,913)
     &sql(SELECT LCASE(:a) INTO :b )
     IF SQLCODE'=0 {
       WRITE !,"Error code ",SQLCODE }
     ELSE {WRITE !,a,!,b }
  }
  ELSE {WRITE "This example requires a Unicode installation of Caché"}
 
See Also