Subject | RE: [ib-support] Question about update - trigger |
---|---|
Author | wasith zaki |
Post date | 2003-04-11T08:25:45Z |
Thank you very much Thomas, it works.
> -----Original Message-----
> From: Thomas Steinmaurer [mailto:ts@...]
> Sent: Friday, April 11, 2003 14:59
> To: ib-support@yahoogroups.com
> Subject: RE: [ib-support] Question about update - trigger
> The main problem is that (NEW.PVI_ID <> OLD.PVI_ID) will fail
> if either the new or the old value of PVI_ID is NULL. So, in
> that case the update will simply not happen.
>
> There is only way to "catch" a change in a column, namely with
>
> IF (((OLD.PVI_ID IS NULL) AND (NEW.PVI_ID IS NOT NULL)) OR
> ((OLD.PVI_ID IS NOT NULL) AND (NEW.PVI_ID IS NULL)) OR
> (OLD.PVI_ID <> NEW.PVI_ID)) THEN
> UPDATE TBADDRESS ...