lower

<< log10 | FB 2.1 Language Reference | lpad >>
<< log | FB 2.0 Language Reference | lpad >>

lower

Library: ib_udf

Added in: IB

Changed in: 2.0

Better alternative: 2.0 use the 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:

  • Depending on how you declare it (see CSTRING note), this function can accept and return strings of up to 32767 characters.
  • Before Firebird 2.0, the result type was CHAR(n).
  • In Firebird 1.5.1 and below, the default declaration used CSTRING(80) instead of CSTRING(255).

back to top of page
<< log10 | FB 2.1 Language Reference | lpad >>
<< log | FB 2.0 Language Reference | lpad >>