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

lower

Library: ib_udf

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 new, superior internal function LOWER instead. Just dropping the declaration of the lower UDF should do the trick, unless you gave it an alternative name.

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 to avoid confusion with the new internal function LOWER.

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: logFirebird Documentation IndexUp: External functions (UDFs)Next: lpad
Firebird Documentation IndexFirebird 2.0 Language Ref. UpdateExternal functions (UDFs) → lower