A BOOLEAN expression is an expression that returns a BOOLEAN value-TRUE, FALSE, or NULL.
The simplest BOOLEAN expression is a BOOLEAN literal, constant, or variable.
The following are BOOLEAN expressions:
You use BOOLEAN expressions as conditions in control statements and in SQL WHERE clauses.
You can use a BOOLEAN variable itself as a condition.
In the following code, the conditions in the loops are equivalent.
SQL> SQL> DECLARE-- from w w w. ja v a 2 s .c o m 2 done BOOLEAN; 3 BEGIN 4 -- These WHILE loops are equivalent 5 6 done := FALSE; 7 WHILE done = FALSE 8 LOOP 9 done := TRUE; 10 END LOOP; 11 12 done := FALSE; 13 WHILE NOT (done = TRUE) 14 LOOP 15 done := TRUE; 16 END LOOP; 17 18 done := FALSE; 19 WHILE NOT done 20 LOOP 21 done := TRUE; 22 END LOOP; 23 END; 24 / PL/SQL procedure successfully completed. SQL>