lower

<< log10 | FB 2.5 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.

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:

  • 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.5 Language Reference | lpad >>