Use the NVL() against a non-initialized BOOLEAN variable: : Boolean « Data Type « Oracle PL / SQL






Use the NVL() against a non-initialized BOOLEAN variable:

  
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>

   
    
  








Related examples in the same category

1.PL/SQL BOOLEAN datatypes accept only TRUE, FALSE, NULL
2.Define and use boolean value
3.Boolean data type with If statement
4.Boolean literals
5.Boolean expressions in where clause
6.Assign a value to a variable of type boolean. Don't use quotes around the value like this