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!

PL/SQL TRIGGER BEFORE DELETE OR INSERT OR UPDATE

800039Sep 24 2010 — edited Sep 24 2010
Dear


I have 2 tables; Catalog and Catalog_bak (read back as backup)

I need a trigger which, after a DML (INSERT/UPDATE/DELET), copies all the info from the Catalog table to Catalog_bak table adding 2 extra fields: change_type, change_date.

The field change_type has to show a value responding to the DML which fired the trigger. If the trigger is fired through a
INSERT ==> 1
UPDATE ==> 2
DELETE ==> 3

So my question is: How can I determine if it was an INSERT, UPDATE or DELETE command which fired this trigger.


Yours Sincerely



Christof
This post has been answered by Hoek on Sep 24 2010
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 22 2010
Added on Sep 24 2010
7 comments
12,155 views