Firebird Documentation IndexFirebird 2.5 Language Ref. UpdateOperators and predicates → NULL literals allowed as operands
Firebird Home Firebird Home Prev: Operators and predicatesFirebird Documentation IndexUp: Operators and predicatesNext: || (string concatenator)

NULL literals allowed as operands

Changed in: 2.0

Description: Before Firebird 2.0, most operators and predicates did not allow NULL literals as operands. Tests or operations like “A <> NULL”, “B + NULL” or “NULL < ANY(...)” would be rejected by the parser. Now they are allowed almost everywhere, but please be aware of the following:

The vast majority of these newly allowed expressions return NULL regardless of the state or value of the other operand, and are therefore worthless for any practicle purpose whatsoever.

In particular, don't try to determine (non-)nullness of a field or variable by testing with “= NULL” or “<> NULL”. Always use “IS [NOT] NULL”.

Predicates: The IN, ANY/SOME and ALL predicates now also allow NULL literals where they were previously taboo. Here too, there is no practical benefit to enjoy, but the situation is a little more complicated in that predicates with NULLs do not always return a NULL result. For details, see the Firebird Null Guide, section Predicates.

Prev: Operators and predicatesFirebird Documentation IndexUp: Operators and predicatesNext: || (string concatenator)
Firebird Documentation IndexFirebird 2.5 Language Ref. UpdateOperators and predicates → NULL literals allowed as operands