Subject | Re: Accepted way to handle BOOLEAN value? |
---|---|
Author | Adam |
Post date | 2008-02-19T00:17:35Z |
--- In firebird-support@yahoogroups.com, "Frank Marousek" <frank@...>
wrote:
which to handle boolean values in Firebird?
The usual way is a domain restricting a base type to two values. The
usual ones are 0/1 based on a smallint field, or 'T'/'F' based on a
char(1) field.
eg.
CREATE DOMAIN BOOLCHAR AS Char(1)
check( (value in ('T','F')) or value is null );
Drop the null condition if you don't want to allow nulls in that domain.
Adam
wrote:
>BOOLEAN data type. Can someone tell me what is the accepted manner in
> I'm new to Firebird, and migrating from a database that has a
which to handle boolean values in Firebird?
The usual way is a domain restricting a base type to two values. The
usual ones are 0/1 based on a smallint field, or 'T'/'F' based on a
char(1) field.
eg.
CREATE DOMAIN BOOLCHAR AS Char(1)
check( (value in ('T','F')) or value is null );
Drop the null condition if you don't want to allow nulls in that domain.
Adam