Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why we haven't boolean datatype in Firebird?

Unless I'm totally wrong, we have no boolean datatype (1 bit) in Firebird, even SQL Server. Why? I think boolean usefull in various situations... And very low space consuption...

like image 410
Alex Avatar asked Feb 15 '11 17:02

Alex


2 Answers

Firebird 3 introduces the boolean datatype. See the Firebird 3 release notes, BOOLEAN data type. You can get Firebird 3 from http://www.firebirdsql.org/en/firebird-3-0/

See also the original announcement: http://asfernandes.blogspot.com/2010/12/introducing-boolean-datatype.html

like image 137
Harriv Avatar answered Oct 06 '22 05:10

Harriv


you have to create domain for it

CREATE DOMAIN D_BOOLEAN
 AS smallint
 CHECK (VALUE IS NULL OR VALUE IN (0, 1));

and then

alter table sometable add somefield d_boolean

works perfectly at our DB :)

like image 30
Lightning3 Avatar answered Oct 06 '22 06:10

Lightning3