开发者

Why we haven't boolean datatype in Firebird?

开发者 https://www.devze.com 2023-02-11 03:41 出处:网络
Unless I\'m totally wrong, we have no boolean datatype (1 bit) in Firebird, even SQL Server. Why? I think boolean usef开发者_如何学Goull in various situations... And very low space consuption...Firebi

Unless I'm totally wrong, we have no boolean datatype (1 bit) in Firebird, even SQL Server. Why? I think boolean usef开发者_如何学Goull in various situations... And very low space consuption...


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


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 :)


Firebird has booleans, in the form of the bit data type.

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

FTA:

Converting the bit data type

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

The acceptable values can be restricted using domains. For more information on Firebird domains, see the Data Definition documentation.

0

精彩评论

暂无评论...
验证码 换一张
取 消