background image
<< INTEGER function | LOCATE function >>

LCASE or LOWER function

<< INTEGER function | LOCATE function >>
Derby Reference Manual
131
FROM EMPLOYEE
ORDER BY 1 DESC
LCASE or LOWER function
LCASE or LOWER takes a character expression as a parameter and returns a string in
which all alpha characters have been converted to lowercase.
Syntax
LCASE or LOWER ( CharacterExpression )
A CharacterExpression is a CHAR, VARCHAR, or LONG VARCHAR data type or any
built-in type that is implicitly converted to a string (except a bit expression).
If the parameter type is CHAR or LONG VARCHAR, the return type is CHAR or LONG
VARCHAR. Otherwise, the return type is VARCHAR.
The length and maximum length of the returned value are the same as the length and
maximum length of the parameter.
If the CharacterExpression evaluates to null, this function returns null.
Examples
-- returns 'asd1#w'
VALUES LOWER('aSD1#w')
SELECT LOWER(flight_id) FROM Flights
LENGTH function
LENGTH is applied to either a character string expression or a bit string expression and
returns the number of characters in the result.
Because all built-in data types are implicitly converted to strings, this function can act on
all built-in data types.
Syntax
LENGTH ( { CharacterExpression | BitExpression } )
Examples
-- returns 20
VALUES LENGTH('supercalifragilistic')
-- returns 1
VALUES LENGTH(X'FF')
-- returns 4
VALUES LENGTH(1234567890)
LN or LOG function
The LN and LOG functions return the natural logarithm (base e) of the specified number.
The specified number must be a
DOUBLE PRECISION
number that is greater than zero
(0).
· If the specified number is NULL, the result of these functions is NULL.
· If the specified number is zero or a negative number, an exception is returned that
indicates that the value is out of range (SQL state 22003).
The data type of the returned value is a DOUBLE PRECISION number.
Syntax