1

Let me elaborate on the title.

Suppose we have two tables, t1 and t2. t2 has a trigger t2_trgon it. Same transaction inserts/updates data in t1, then does insert/update in t2. t2_trg is fired and starts doing its thing. Is this trigger able to see all the changes done in t1?

P.s. I found other topics on this problem, but they we're mostly for SQL Server.

1
  • Yes, unless the trigger created with PRAGMA AUTONOMOUS_TRANSACTION
    – a1ex07
    Commented Oct 7, 2014 at 14:26

1 Answer 1

3

Regular trigger will see changes made in other tables within the same transaction. However, if you create the trigger (or other programmable object) with PRAGMA AUTONOMOUS_TRANSACTION, it will be executed within the scope of new transaction and won't be able to see "parent" transaction changes.

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.