Subject | Re: [firebird-support] Re: The New command in triggers |
---|---|
Author | Milan Babuskov |
Post date | 2006-02-15T23:11:56Z |
Christian Danner wrote:
Take for example if old.field is NULL and new.field is not NULL.
step 1:
One of the main problems people encounter is that not(null) does not
give TRUE, but rather NULL.
--
Milan Babuskov
http://njam.sourceforge.net
http://www.flamerobin.org
> So if the number of comparisons really matters (3:5):Not good.
>
> if (not( ( (old.field is null)
> and (new.field is null))
> or (old.field = new.field)))
> then
> ...
Take for example if old.field is NULL and new.field is not NULL.
step 1:
> if (not( ( (NULL is null)step 2:
> and (NOTNULL is null))
> or (old.field = new.field)))
> if (not( ( TRUEstep 3:
> and FALSE)
> or (old.field = new.field)))
> if (not( (FALSE)step 4:
> or (old.field = new.field)))
> if (not( (FALSE)step 5:
> or (NULL = NOTNULL)))
> if (not( (FALSE)step 6:
> or (NULL)))
> if (not( NULL))step 7:
> if (NULL)The expression doesn't evaluate to TRUE, so body will not execute.
One of the main problems people encounter is that not(null) does not
give TRUE, but rather NULL.
--
Milan Babuskov
http://njam.sourceforge.net
http://www.flamerobin.org