8

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...

lospejos
  • 1,976
  • 3
  • 19
  • 35
Alex
  • 3,325
  • 11
  • 52
  • 80

3 Answers3

14

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

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
Harriv
  • 6,029
  • 6
  • 44
  • 76
5

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

Lightning3
  • 375
  • 7
  • 18
-3

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.

  • 7
    I disagree, Firebird does not have a bit data type also, as your post states at first, but clarifies then... what Firebird have is Integer and Chars to emulate the bit or boolean fields. – jachguate Feb 16 '11 at 15:13
  • 3
    I also think that *emulation* does not equal to the native boolean data type. – Wodzu Jun 29 '12 at 17:51