Internal functions and directives
<< NULL in operations | Firebird Null Guide | Predicates >>
Internal functions and directives
Internal functions
The following built-in functions return NULL
if at least one argument is NULL
:
CAST()
EXTRACT()
GEN_ID()
SUBSTRING()
UPPER()
LOWER()
BIT_LENGTH()
CHAR[ACTER]_LENGTH()
OCTET_LENGTH()
TRIM()
Notes
• In 1.0.0, EXTRACT
from a NULL
date would crash the server. Fixed in 1.0.2.
• If the first argument to GEN_ID
is a valid generator name and the second argument is NULL
, the named generator keeps its current value.
• In versions up to and including 2.0, SUBSTRING
results are sometimes returned as "false emptystrings". These strings are in fact NULL
, but are described by the server as non-nullable. Therefore, most clients show them as empty strings. See the bugs list for a detailed description.
FIRST
, SKIP
and ROWS
The following two directives crash a Firebird 1.5.n or lower server if given a NULL
argument. In Firebird 2, they treat NULL
as the value 0
:
This new Firebird 2 directive returns an empty set if any argument is NULL
:
Side note: ROWS
complies with the SQL standard. In new code, use ROWS
, not FIRST
and SKIP
.
back to top of page
<< NULL in operations | Firebird Null Guide | Predicates >>