G-2150: Avoid comparisons with NULL value, consider using IS [NOT] NULL.
Blocker
Portability, Reliability
Reason
The NULL value can cause confusion both from the standpoint of code review and code execution. You must always use the IS NULL
or IS NOT NULL
syntax when you need to check if a value is or is not NULL
.
Example (bad)
DECLARE
l_value INTEGER;
BEGIN
IF l_value = NULL THEN
NULL;
END IF;
END;
/
Example (good)
DECLARE
l_value INTEGER;
BEGIN
IF l_value IS NULL THEN
NULL;
END IF;
END;
/