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!

Triggers and/or Scheduler -- REPLACE a DML statement when triggered?

Bob BrylaDec 6 2013 — edited Dec 6 2013

For every DML from a group of users, I want to trap the DML against several or all tables (that's the easy part).

But instead of proceeding with just changing column values before or after the DML event, I want to substitute an alternate DML statement based on the table, user, and so forth.

I know that triggers can't do COMMIT or transactions unless I use a PRAGMA, and I know I can retrieve the actual SQL statement in a trigger (if that's the best place to trap it), so I can use DBMS_SCHEDULER or similar.

But HOW do I "abort" the original DML statement from the trigger point of view without raising an exception... or raise an exception but return a non-exception error code? I don't want to abort the calling procedure by passing the exception handling to it.

OR, any other ideas on how to do this... THANKS

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 3 2014
Added on Dec 6 2013
7 comments
462 views