Subject Re: Equivalent to ENUM?
Author Adam
> Hello folks,
>
> Is there an equivalent to ENUM(-1,0) which I can use for boolean
fields.
> I am trying to ween my office off Microsoft Access as theor database,
> but they simply won't stop using Access as the front-end. We have made
> extensive use of checkboxes in the past to speed up the work but I'm
> afraid they'll choke on using Firebird unless I can provide a totally
> transparent chage over for them. They are not interested in the
> background advantages of the change over, they just want EXACTLY the
> same interface they're used to. I've solved the case insensitive search
> issue, but this checkbox lark could be a deal breaker.
>
> Alternatively, how do I get access to use 1 and 0 instead of -1 and
0 in
> checkboxes? ;-)

Firebird does not have a boolean datatype at all. It has something
called a 'domain' which can (and should) be used for defining a custom
type which only accepts two values, we also have one that allows nulls
for when that is appropriate. We use a field that only accepts 'T' or
'F' based on char(1), others use a smallint 0,1 etc. In other words,
if access feeds it -1 or 0, then Firebird will store -1 or 0. It
doesn't care what they stand for. So it is not really a problem for
Firebird. Perhaps you could clarify what you think the problem will be?

You could create a UDF function to convert one to the other, or use
triggers to do the translation before insert/update.

Adam