Re: About UPDATE triggers...
Posted in 1997
In <0005D1F1.1825@ccsmtp.farinon.harris.com>,
MMASHALK@ccsmtp.farinon.harris.com wrote:
<snip>
>
> In Informix triggers (Update Trigger on a table for all columns
> [default]), is there a way of finding out which columns are
> getting updated ?
>
> In Oracle, you can do IF UPDATING (column_name). You can check
> by comparing pre.column_name with post.column_name. But if a
> column is being updated with the old value it self then this
> would not be useful.
>
<snip>
Trigger code below, explains how the kind of logic that you have asked,
can be done, in Informix.
create trigger tu_tabname update on tabname
referencing old as old new as new
for each row
when (((new.col01 is null and old.col01 is not null)
or (new.col01 is not null and old.col01 is null)
or (new.col01 != old.col01)))
(execute procedure proc_name(...)),
.
.
.
when (((new.col0n is null and old.col0n is not null)
or (new.col0n is not null and old.col0n is null)
or (new.col0n != old.col0n)))
(execute procedure proc_name(...));
--
Have a nice day
Felix K. Mathews
mailto:fmathews@systems.dhl.com