Subject | Re: [ib-support] expression evaluation |
---|---|
Author | Doug Chamberlin |
Post date | 2002-12-21T01:21:06Z |
At 12/20/2002 07:58 PM (Friday), Lauri Zoova wrote:
results in NULL except testing for it.)
An easier way to code the multiple tests is to transfer the values from the
fields into variables declared in your trigger procedure. Assign the
variables from the fields. For each variable, if it is NULL set it to some
out-of-bounds value. Finally, do the normal logic tests you would have
otherwise done but use the variables instead of the fields. That way your
logic is not cluttered up with NULL tests.
>If i have an after(or before, does not matter) update trigger with theThis is standards-conforming behaviour. (Any operation involving NULL
>following in it:
>if new.field <> old.field then [do something that takes a long time and
>needs to be done only when this field changes]
>
>..it evaluates to false when old value is null.
>[snipped]
>This seems absurd. Is this a feature or a bug or does some standard say
>that this is the way it should be?
>Again - is there another way to do this?
results in NULL except testing for it.)
An easier way to code the multiple tests is to transfer the values from the
fields into variables declared in your trigger procedure. Assign the
variables from the fields. For each variable, if it is NULL set it to some
out-of-bounds value. Finally, do the normal logic tests you would have
otherwise done but use the variables instead of the fields. That way your
logic is not cluttered up with NULL tests.