check out
if :old.column != :new.column
then update table
:old is your before update image
:new is the data in the column after the update.
>
> From: "Joehnk, John" <john.[Email Address Removed] Date: 2003/06/30 Mon AM 10:54:17 EDT
> To: "LazyDBA.com Discussion" <[Email Address Removed] Subject: Trigger question for record update
>
> Running Oracle 7.3.4 and have an application (not written in house) that allows a person to go into an update screen, unfortunately it seems as if even if the person makes no changes, if they do not back out, it writes - or updates - the record even if there were no changes.
>
> We wanted to create a history of changes so I created a trigger where after the update of a record, the old values were written to the history table.
>
> Out history is now full of record that did not really change.
>
> How could I check to see if the record REALLY changed to determine if I need to write the record to the history table.
>
> the table has 133 columns, so checking each one is possible, but I was hoping for some way to check the entire record without going column by column.
>
> Any thoughts?
>
> Thank You
>
> John Joehnk
> Scroll Technologies
>
>
Oracle LazyDBA home page