Subject Re: [firebird-support] A few Firebird questions about future features
Author Martijn Tonies
> > Are there any plans to add support for true booleans? If yes, which
> > version will support this?
>
> You can easily add boolean type via domains:
>
> CREATE DOMAIN BOOLEAN
> AS SMALLINT
> CHECK (value is null or value in (0, 1));
>
> And use it like this:
>
> CREATE TABLE t1
> (
> C1 VARCHAR(10),
> B1 BOOLEAN,
> B2 BOOLEAN NOT NULL,
> ...
> );
>
> As you can see, not much different than 'real' boolean.

Well, except that INSERT INTO t1 VALUES ('', TRUE, FALSE)
won't work.

Neither will a query:

WHERE B1 AND ...

Or:
declare variable myvar boolean;

myvar = exists( ... );


Etc.

Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, NexusDB, Oracle &
MS SQL Server
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com