Oracle – Does Trigger See All Changes Done in the Transaction It Was Fired From?

oracleoracle-11g-r2transactiontrigger

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.

Best Answer

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.