Subject Re: [firebird-support] Boolean Fields
Author Ann W. Harrison
At 10:58 AM 10/28/2004, Ken Galbraith wrote:

>Coming from the old school (I am 57 and started programming in 1967) I have
>used signed integers (16 bit) to store up to 15 separate fields, using
>functions to set/get individual flags based on 2^n etc.

As I say to my husband (he and I are just about your age) "Get over it, Jim,
the great bit depression ended twenty years ago."

There are UDF's that support bitwise operations, but the overhead of the
UDF plus the overhead in your program of getting the right bits in the
right place will swamp any gain you get by packing your flags into single
integers.

>Should I use Integer/Big Int & concatenate my Boolean fields, or should I
>convert them to char(1) values of "y"/"n" etc or smallint values of 0/1.

Use char(1). The engine will pick a fast comparison since it knows its
comparing one byte to another. If it makes you happy, make them charset
octets and store 0x1 and 0x0.
>

Regards,

Ann