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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Commit to part of procedure called by trigger

User_8P4FCMay 31 2018 — edited May 31 2018

hello

i have a trigger that calls a procedure; this procedure calls several other procedures (that a.o do dml to different tables) . i need to capture data of one of these dml in an error table, as it fails due to pk constraint (i want to capture in en separate error table the data set that oracle is trying to insert while getting a pk violation); i added a piece of code that will do the insert into the error table , and put around it a pragma autonomous transaction with commit

with this set up im getting en error 'cannot COMMIT in a trigger';

can i NOT use the pragma for only a small piece of the procedure so that all the other dml's roll back and mine with error capturing not?

with this set up oracle does not even arrive at the orignal pk error, so i know its my piece of code with pragma and commit that is causing that;

i appreciate your tips here on how i can resolve that

thanks

rgds

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 28 2018
Added on May 31 2018
6 comments
910 views