I l@ve RuBoard Previous Section Next Section

Logical Data Types

Logical data types are used to represent the concepts of true, false, or NULL. Typically, this data type is useful as a flag that indicates the current state of a record. The true and false values are self-explanatory, while the value NULL usually indicates the equivalent of "unknown."

BOOLEAN

Description

Holds a logical true, a logical false, or a NULL value.

Inputs

TRUE, t, true, y, yes, 1—All valid TRUE values.

FALSE, f, false, n, no, 0—All valid FALSE values.

NULL—Valid NULL value.

Storage Size

1 byte

Notes

Generally, it is best to use the TRUE and FALSE input forms for Boolean data. These formats are SQL compatible and generally are more accepted, although some RDBMSs use 1 and 0 for TRUE and FALSE representations. Some of the input values need to be escaped by enclosing them in single quotes (i.e., 't'). However, the SQL-compliant TRUE and FALSE forms do not require quotations.

    I l@ve RuBoard Previous Section Next Section