Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

[row trigger] generic access to fields

TPD-OpitzNov 15 2010 — edited Nov 29 2010
Hello,

I'm trying to create an after insert/update row trigger that copies (all) current values to a corresponding history table. I'd like to create a generic triger that does not need any change if source and target table have their fields modified.

Unfortunately a insert into target_table select :new.* from dual; does not compile on a 10g database.

insert into target_table select * from source_table where ID = :new.id; raises the mutating table error and encapsulating this select in an autonomous transaction does not see the new values.

The only way out of this problem I found was to remember the altered ID's in a temporary table and copy the values within an after statement trigger.

Is there any other solution?

bye
TPD
This post has been answered by Hoek on Nov 15 2010
Jump to Answer

Comments

Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Dec 27 2010
Added on Nov 15 2010
22 comments
399 views