PL/SQL (MOSC)

MOSC Banner

Oracle mutating table question

edited May 28, 2010 3:12AM in PL/SQL (MOSC) 14 commentsAnswered ✓
 May 5, 2010:

Hello,

     For certain condidtion, when a row is inserted into a table, we'd like to automatically (e.g. via trigger) insert a second row into the same table.

     Without an autonomoys_transaction directive, we get a mutating table error which we guess is what would be expected. 

      Below is example code we used for testing this concept.  Are there any downsides/gotchas to using autonomous_transaction for this kind of after-insert case?  E.g.

CREATE OR REPLACE TRIGGER schema.trigger_operations_after       AFTER INSERT ON operations       FOR EACH ROW     DECLARE       PRAGMA AUTONOMOUS_TRANSACTION;     BEGIN       IF :NEW.servcode = 'IKRB' THEN

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center