Boolean literals : Boolean « Data Type « Oracle PL / SQL






Boolean literals

  
SQL>
SQL> SET SERVEROUTPUT ON
SQL>
SQL>
SQL> DECLARE
  2     v_true BOOLEAN := TRUE;
  3     v_false BOOLEAN := FALSE;
  4     v_null BOOLEAN := NULL;
  5  BEGIN
  6     IF v_true
  7     THEN
  8        DBMS_OUTPUT.PUT_LINE('true');
  9     END IF;
 10     IF v_false
 11     THEN
 12        DBMS_OUTPUT.PUT_LINE('false');
 13     END IF;
 14     IF v_null
 15     THEN
 16        DBMS_OUTPUT.PUT_LINE('null');
 17     END IF;
 18  END;
 19  /
true

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.Use the NVL() against a non-initialized BOOLEAN variable:
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