Defining a BOOLEAN Domain - Firebird

Up to and including release 1.5, Firebird does not provide a Boolean type. A Boolean- styled domain is ideal, because you can define attributes that will be consistent across all tables. It is recommended that you use the smallest possible data type: a CHAR for T[rue]/F[alse] or Y[es]/N[o] switches or a SMALLINT 1/0 pairing. The following examples suggest ways you might implement your Booleans.

A Two-Phase Switch That Defaults to 'F' (False)

A Three-Phase Switch That Allows UNKNOWN (i.e., NULL)

A Three-Phase Switch That Represents UNKNOWN As a Value

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

Firebird Topics