Logic operator and boolean value : Boolean « PL SQL Data Types « Oracle PL/SQL Tutorial






SQL>
SQL>
SQL> DECLARE
  2    end_of_file1  BOOLEAN := TRUE;
  3    end_of_file2  BOOLEAN := FALSE;
  4    checkline  VARCHAR2(80) := '1234';
  5    againstline  VARCHAR2(80) := 'abcd';
  6    retval  BOOLEAN;
  7  BEGIN
  8    LOOP
  9      -- ...
 10      IF (end_of_file1 AND end_of_file2)
 11      THEN
 12        retval := TRUE;
 13        EXIT;
 14      ELSIF (checkline != againstline)
 15      THEN
 16        retval := FALSE;
 17        EXIT;
 18      ELSIF (end_of_file1 OR end_of_file2)
 19      THEN
 20        retval := FALSE;
 21        EXIT;
 22      END IF;
 23    END LOOP;
 24  END;
 25  /

PL/SQL procedure successfully completed.

SQL>
SQL>








21.13.Boolean
21.13.1.BOOLEAN
21.13.2.Boolean literals
21.13.3.Boolean variables can be assigned either directly by using values TRUE, FALSE, or NULL or as the results of logical expressions
21.13.4.How to assign a TRUE value to a variable of type boolean
21.13.5.Use BOOLEAN type variable
21.13.6.Use 'and' to connect two boolean expressions
21.13.7.Demonstrates the effects of NULLs on Boolean expressions
21.13.8.Boolean type parameter
21.13.9.Exit when a boolean conditioin
21.13.10.Logic operator and boolean value