Firebird Documentation IndexFirebird 2.5 Language Ref. UpdateExternal functions (UDFs) → lower
Firebird Home Firebird Home Prev: log10Firebird Documentation IndexUp: External functions (UDFs)Next: lpad

lower

Library: ib_udf

Added in: IB

Changed in: 2.0

Better alternative: Internal function LOWER()

Description: Returns the lower-case version of the input string. Please notice that only ASCII characters are handled correctly. If possible, use the superior internal function LOWER instead.

Result type: VARCHAR(n)

Syntax: 

"LOWER" (str)

Declaration: 

DECLARE EXTERNAL FUNCTION "LOWER"
   CSTRING(255) NULL
   RETURNS CSTRING(255) FREE_IT
   ENTRY_POINT 'IB_UDF_lower' MODULE_NAME 'ib_udf'

The above declaration is from the file ib_udf2.sql. "LOWER" has been surrounded by double-quotes because LOWER, being a reserved word, cannot be used as an identifier except when quoted. When you call the function, you also have to add the quotes and use the exact capitalization, otherwise the internal function will take precedence. (Most other internal function names are not reserved words; in those cases, the external function prevails if it is declared.)

The NULL after CSTRING(255) is an optional addition that became available in Firebird 2. When declared with the NULL keyword, the engine will pass a NULL argument unchanged to the function. This leads to a NULL result, which is correct. Without the NULL keyword (your only option in pre-2.0 versions), NULL is passed to the function as an empty string and the result is an empty string as well.

For more information about passing NULLs to UDFs, see the note at the end of this book.

Notes: 

Prev: log10Firebird Documentation IndexUp: External functions (UDFs)Next: lpad
Firebird Documentation IndexFirebird 2.5 Language Ref. UpdateExternal functions (UDFs) → lower