Subject | Re: [firebird-support] Boolean Fields |
---|---|
Author | Ann W. Harrison |
Post date | 2004-10-28T18:27:29Z |
At 10:58 AM 10/28/2004, Ken Galbraith wrote:
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.
comparing one byte to another. If it makes you happy, make them charset
octets and store 0x1 and 0x0.
Ann
>Coming from the old school (I am 57 and started programming in 1967) I haveAs I say to my husband (he and I are just about your age) "Get over it, Jim,
>used signed integers (16 bit) to store up to 15 separate fields, using
>functions to set/get individual flags based on 2^n etc.
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 IUse char(1). The engine will pick a fast comparison since it knows its
>convert them to char(1) values of "y"/"n" etc or smallint values of 0/1.
comparing one byte to another. If it makes you happy, make them charset
octets and store 0x1 and 0x0.
>Regards,
Ann