Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> trigger advice please
Ok, I have a table that has a few columns in it that I want to monitor for changes. I created a table for a trigger to insert rows in when these columns are updated, in this table I have two columns for each one column that I want tracked in the other table, one of them for the old value, one for the new.
Following is the trigger I wrote to accomplish this:
create or replace trigger tr_aud_table
before update on schema.table_name
for each row
begin
insert into schema.audit_changes
(ref_number,
change_date,
user,
old_col1, old_col2, old_col3)
OLD:col1, OLD:col2, OLD:col3)
new_col1 = NEW:col1, new_col2 = NEW:col2, new_col3 = NEW:col3
thanks in advance
Sent via Deja.com
http://www.deja.com/
Received on Wed Jan 24 2001 - 23:11:30 CST
![]() |
![]() |