Why don't we have a boolean data type in Firebird?

If I am not mistaken, we do not have a logical data type (1 bit) in Firebird, even SQL Server. What for? I think boolean is useful in various situations ... And very low spatial absorption ...

+7
source share
3 answers

Firebird has booleans as a bit data type.

http://www.firebirdsql.org/manual/migration-mssql-data-types.html

FTA:

Bit data type conversion

The bit data type is used to store a single logical value, 0 or 1. MS SQL does not support assigning NULL to these fields. InterBase can emulate this using an INTEGER or CHAR (1) type.

Valid values ​​can be limited using domains. For more information about Firebird domains, see the data definition documentation.

-3
source

Firebird 3 introduces a logical data type. See 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

+12
source

you need to create a 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 great in our database :)

+4
source

All Articles