Subject Re: AW: [firebird-support] trigger in firebird 2.1.1
Author Thomas Steinmaurer
> I'm sorry, my mistake.
>
> One condition makes me trouble with NULL as you thought. The "Bemerkung" -
> comment-field was set to null as default value. Now, I change the value and
> old.value<> new.value doesn't work, because the old value is NULL. After I
> change the value again, it works.

Yeah, my crystal ball strikes back. ;-)


> Now, I have added the follow condition:
>
> If(old.comment<>new.comment) or ((old.comment is null)and(new.comment is not
> null))
>
> Is there a better way to compare?

As previously mentioned, use the IS DISTINCT FROM clause.

IF (old.comment IS DISTINCT FROM new.comment) THEN
BEGIN
...
END



Thomas