Boolean

From Oracle FAQ
Jump to: navigation, search

Boolean is a PL/SQL data type used to declare variables that can take one of the following values: TRUE, FALSE or NULL.

Example[edit]

DECLARE
  v_bool BOOLEAN := FALSE;
BEGIN
  v_bool := TRUE;
END;

Please note that "boolean" cannot be used as the datatype of a column (BOOLEAN is a PL/SQL-only type). Use something like this instead:

... col1 NUMBER(1,0) CHECK (col1 IN (1,0)),
... col2 VARCHAR2(1) CHECK (col2 IN ('T','F')),
Glossary of Terms
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z #