我試圖重新創建你的場景,它似乎對我來說工作得很好。所以我認爲你應該再看看你的實現。尋找你所編碼的內容與這裏的內容之間的區別,也許這就是答案的出處。
這裏是我的觸發器
SQL> create or replace
2 trigger t1_compound
3 for insert or update on t1
4 compound trigger
5
6 after statement is
7 begin
8 update t2 set t1_id = nvl(t1_id,0) + 1 where cod = 12;
9 end after statement;
10 end;
11/
Trigger created.
SQL>
SQL> create or replace
2 trigger t2_compound
3 for insert or update on t2
4 compound trigger
5
6 after statement is
7 begin
8 update t3 set t2_id = nvl(t2_id,0) + 1 where cod = 12;
9 end after statement;
10 end;
11/
Trigger created.
SQL>
...這裏是測試數據...
SQL> select id, cod from t1
2/
ID COD
---------- ----------
1 12
SQL> select id, cod, t1_id from t2
2/
ID COD T1_ID
---------- ---------- ----------
11 12
SQL> select id, cod, t2_id from t3
2/
ID COD T2_ID
---------- ---------- ----------
111 12
SQL>
...這是什麼情況,當我發出第一個表的更新...
SQL> update t1 set dt = sysdate
2 where id = 1
3/
1 row updated.
SQL> select id, cod, t1_id from t2
2/
ID COD T1_ID
---------- ---------- ----------
11 12 1
SQL> select id, cod, t2_id from t3
2/
ID COD T2_ID
---------- ---------- ----------
111 12 1
SQL>
來源
2010-01-05 13:15:54
APC
是什麼在THEOTHERTABLE觸發什麼樣子的? – 2010-01-07 01:31:59
這是一個簡單的觸發器,更新THEOTHERTABLE時觸發。我已經嘗試在每行之前輸出到dbms_output,並且在語句之後,它在編譯觸發器TRIGGER之後第一次觸發 – Joao 2010-01-07 16:28:50