Comparing any variable with NULL will always evaluate to FALSE, regardless if it's value, unless IS NULL or IS NOT NULL is used.
Violating this rule will affect the functionality of the code.The severity is critical which means that the code will not function correctly.
This is an easy mistake to do, especially when editing different types of languages, since PL/SQL is a bit special in this regard. Comparing any variable with NULL will always evaluate to FALSE, regardless if it's value, unless IS NULL or IS NOT NULL is used.
Even if this code looks OK at a quick glance, neither the IF section nor the ELSIF section will be executed.
... IF (country_ = NULL) THEN --This section will never be executed country_ := Get_Default_Country; END IF; ... IF (country_ != NULL) THEN --This section will never be executed Set_Country(country_); END IF; ...
These kind of constructs are easily corrected, by replacing the '=' with 'IS' and the '!=' with 'IS NOT', as shown in the example below.
... IF (country_ IS NULL) THEN --Executed when country_ is null country_ := Get_Default_Country; END IF; ... IF (country_ IS NOT NULL) THEN --Executed when country_ has a value Set_Country(country_); END IF; ...
This page is generated from IFS Developer Studio at 2025-03-23 11:16.