Sample Header Ad - 728x90

How can I RAISE_APPLICATION_ERROR and do an INSERT in the same trigger?

0 votes
1 answer
587 views
From what I see, having the RAISE_APPLICATION_ERROR cancels the other operations that I would have in the trigger. I tried writing first the INSERT and then the RAISE_APPLICATION_ERROR hoping that they get executed in the order in which they are read but it doesn't work like this...The error is thrown and the INSERT is canceled. How could I make both of the operations get executed (from the same trigger) ? I also tried creating two triggers .. one of them doing the RAISE_APPLICATION_ERROR part and the other doing the INSERT and establishing the order using FOLLOWS and PRECEDES but it didn't work. The trigger should block the DROP DDL (that's what for I used the RAISE_APPLICATION_ERROR) and it also should do an insert in a LOG type table (that's what for I used the INSERT).
Asked by CCBet (117 rep)
May 2, 2018, 10:11 PM
Last activity: May 2, 2018, 10:28 PM