|Subject||Re: [firebird-support] Simulating Boolean field|
> today morning I was thinking about the Boolean simulation in FB 1.5 . I'veFor NULL you would have to use different query
> found two solutions.
> 1: char(1) with 'T' and 'F' and some validation (check, trigger)
> 2: char(1) with X (as Yes/True) and NULL (No/False)
> What's better (performance, management, ...)?
> How you're working with Boolean?
(i.e. it can cause problems with prepared statements)
WHERE myfield IS NULL
Another alternative is SMALLINT, which has the advantage that
- it is language independent (no variants like T/F, Y/N, A/N, etc)
- it is always sorted correctly (0<1)
- if true boolean will be implemented, it is more likely to be stored as number (I think)