Subject Re: clearing comboBox in grid does not produce NULL
Author Marco Menardi
--- In IBObjects@yahoogroups.com, "scronkey" <nilsson@b...> wrote:
> Hi Marco,
> thanks for your reply.
>
> Just checking something with your description below:
>
> (assuming A is old.VAL & B is new.VAL)
>
> What if A was NULL & B was not?
> This would not then evaluate to true, as A=B won't work, as one of
> the values is NULL,
> and ((A is null) and (B is null)) would not evaluate as one of the
> values is not NULL.
>
> Am I correct here?

let's semplify the condition for this particular case
well, the expression:
not ( A = B or ((A is null) and (B is null)) )
since A=B is False (A is null) and tehre is "OR" we just have to look at:
not (((A is null) and (B is null)))
that is
not (True and False) ->
not (False) ->
True = the two fields are different

>
> Is the solution to also include checks like:
> ((A IS NULL) and (NOT B IS NULL))
>
> I find it a little cumbersome to have to evaluate so many
> conditions, when it seems logical to me that even though NULL is a
> state, not a value, clearly '7' and NULL are not equal...
>
> Rgds,
> -Ryan

I complitely agree, but that's how the game works :)
There are logical reasons to agree with when they tell you that null
is "unknown", so you can't compare with something, but in triggers we
have to intercept field changes, in value or in state, so there is a
need of a better operator that will tell us IF SOMETHING HAS CHANGED.
Unfortunatly, the request of a "==" operator in the FB list was shut
up by the "logical purists" that seem to neve have to check in trigger
for a field change <g>.
Please, go to the Firebird developement list and let's try to fight
again ;)
regards
Marco Menardi