IS NULL Operator
The IS NULL operator returns the Boolean value TRUE whenever its operand is null or FALSE if it is not null. The comparisons including the nulls always yield NULL. And hence, to test for nullity (the state of being null), then do not use the statement
IF variable = NULL THEN...
Rather, use the statement below:
IF variable IS NULL THEN...