Multiple column update trigger
724567May 14 2012 — edited Nov 20 2012Hi,
I want to have a history track of all data that has ever been updated in a table. Say, table1 has 100 columns and to store its data change history, I have made another table track_table1 having columns : updated_column_name, old_data, new_data, mod_time.
For storing this data history, I need to write a trigger in which I will identify all columns that has value updated and insert column's name and values in the track_table1 table.
What I currently do is checking each of 100 column's new and old value inside the trigger to find out which columns have been updated. This increases the code and also oracle has to check each 100 column's values to find out whether it is being updated.
Is there any way where oracle itself can give a list of columns which have values updated by the update statement ? so that there is no need to check old and new values of every column of the table.
I am using oracle 9i and 10g databases.
-----------------------------------
Thanks much in advance,
Kawa