July 2010
Intermediate to advanced
840 pages
16h 33m
English
Since host languages do not support NULLs, the programmer can elect either to replace them with another value that is expressible in the host language or to use indicator variables to signal the host program to take special actions for them.
SQL specifies two functions, NULLIF() and the related COALESCE(), that can be used to replace expressions with NULL, and vice versa. They are part of the CASE expression family.
The NULLIF(V1, V2) function has two parameters. It is equivalent to the following CASE expression:
NULLIF(V1, V2) := CASE
WHEN (V1 = V2)
THEN NULL
ELSE V1 END;That is, when the first parameter is equal to the second, the function returns a NULL; otherwise, it returns ...
Read now
Unlock full access