Boolean Type

RDM provides the standard SQL type BOOLEAN. The BOOLEAN type can have several states: TRUE, FALSE, and a third state, UNKNOWN, which is represented by the SQL NULL value.

Data Type Size Size (Not Null) Synonyms Min Value Max Value
BOOLEAN 2 bytes 1 byte   0 1

The data type input function for type BOOLEAN accepts these string representations for the TRUE state:

true
0

and these representations for the FALSE state:

false
0

Case does not matter.

The data type output function for type BOOLEAN always emits either 1 or 0.

Example Using BOOLEAN Type

rdm-sql: create database test1;
rdm-sql: CREATE TABLE test1 (a boolean, b char(20));
rdm-sql: commit;
rdm-sql: INSERT INTO test1 VALUES (TRUE, 'This is TRUE');
*** 1 row(s) inserted
rdm-sql: INSERT INTO test1 VALUES (FALSE, 'This is FALSE');
*** 1 row(s) inserted
rdm-sql: select * from test1;

     A| B
------+---------------------
     1| This is TRUE
     0| This is FALSE
*** 2 row(s) returned
rdm-sql: select * from test1 where a = true;

     A| B
------+---------------------
     1| This is TRUE
*** 1 row(s) returned

See Also

NULL Values

DEFAULT Values

Limitations