SQL> DECLARE 2 . 3 my_var BOOLEAN; 4 BEGIN 5 6 IF NOT NVL(my_var,FALSE) THEN 7 dbms_output.put_line('This should happen!'); 8 ELSE 9 dbms_output.put_line('This can''t happen!'); 10 END IF; 11 END; 12 / This should happen! PL/SQL procedure successfully completed. SQL>
15.4.NVL2 | ||||
15.4.1. | NVL2(x, value1, value2) returns value1 if x is not null. | |||
15.4.2. | nvl2(comm,12*msal+comm,12*msal) as yearsal | |||
15.4.3. | Use nvl2 to deal with null salary | |||
15.4.4. | Use the NVL() against a non-initialized BOOLEAN variable: |