Subject Re: boolean domain and IBO
Author mmenaz
Dipends ;)
I use char(1) with Y/N, so when I print/display data you can understand the=
meaning of the flags without needing a checkbox
If you user FastReport, when calculating booleans in boolean math, if you d=
on't have a 0/1 range you have an error (since it multiplies the partial val=
ue with the boolean value of the field... i.e. 0/1 (ant it's ok) or Y/N (and=
a number * Y/N is not ok ;))
If you use a definition with "not null" you prevent IBO checkbox from havin=
g a "graied" state.
I do use char also because I store flags with two values like booleans, lik=
e Male/Female, so my field answers the question: "is it male or female? (M/F=
)" and not "is it male? true/False". I've find this more readable than pure =
booleans true/false.
Regards
Marco Menardi

--- In IBObjects@y..., Ale¹ Kahánek <ales.kahanek@n...> wrote:
> Hi All,
> what definition of boolean domain do you recommend when using IBO? Which =
one
> is "better"?
>
> 1. CREATE DOMAIN D_BOOLEAN AS CHAR(1) CHECK (VALUE IN ("T","F")) NOT NULL=
;
>
> 2. CREATE DOMAIN D_BOOLEAN AS SMALLINT DEFAULT 0
> CHECK (VALUE BETWEEN 0 AND 1);
>
> Thanks Ales