Subject Re: [ib-support] Re: expression evaluation
Author Helen Borrie
At 06:26 PM 21-12-02 +0200, you wrote:
>Helen Borrie wrote:
> > Yes, it is dictated by both the standard and Boolean logic. If you would
> > prefer to simplify *your* logic, so that new.field <> old.field always
> > gives true when not (new.field = old.field) then make the columns in
> > question non-nullable and enforce a default value via a Before Insert
> trigger.
>
>This is was not an option in my case. I needed the null state as well.
>
> > "Inconvenient" is strange. After all, you only write the trigger once.
>
>I meant that doing this kind of simple check is more complicated than it
>would seem at first. Needlessly i dare say.
>
> > [...]
> > Just remember that if new.field and old.field are both null, you won't get
> > True on an equivalence comparison either...
>
>So we are back at the beginning :)

We are at fundamentals, I suppose you could say. Unknown == unknown cannot
be evaluated as equal, e.g. Lauri's phone number == Helen's phone number if
you don't know either of them.


> > I think you'll learn to know and love null, all the same. <g>
>
>Oh i love nulls.. i just don't like how they are evaluated. It would be
>logical if null be considered a valueless state, not unknown.

How do you consider "valueless state" and "unknown" to be different, logically?

>Or
>whatever, as long as - [field with a value] <> null = true.

The syntax has semantics for this condition:

[field with a value] IS NULL | IS NOT NULL

>I really can not think of any use for unknown state or a boolean
>condition that can evaluate to unknown. I guess it's my limited mind :))

Turn your thinking around the other way. The state of data is always
KNOWN: it has a value or it has no known value. It would be very
restrictive if "no known value" were predicated as if it could be evaluated
as "something" - apart from the untruth of making null pose as some sort of
value. What would that value be? What would your phone number be assumed
to be if it wasn't known?

>Anyway i got my answer and i guess i will just have to live with it.

That at least has a value - True. <g>

heLen