Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Mutating table error...
Message
General information
Forum:
Oracle
Category:
Triggers, Sequences and Stored Procedures
Miscellaneous
Thread ID:
00654702
Message ID:
00657150
Views:
31
This message has been marked as a message which has helped to the initial question of the thread.
Hi!
This is usually caused by doing sql on the same table the trigger is built on..(if you try to select the trigger table fx...) I don't see the EMPLOYEE
table being used in this way but perhaps one of the tables in the trigger is a view containing EMPLOYEE?

Take a look at
http://osi.oracle.com/~tkyte/Mutate/index.html

If they don't mention it you can also use
PRAGMA AUTONOMOUS TRANSACTION

example:

SQL> CREATE OR REPLACE TRIGGER tbu_short
2 BEFORE UPDATE
3 ON x_short
4 REFERENCING NEW AS NEW OLD AS OLD
5 FOR EACH ROW
6 declare
7 pragma autonomous_transaction;
8 begin
9
10 if (:new.b_default = -1) then
11 update x_short set b_default = 0 where b_default = -1;
12 commit;
13 end if;
14
15 end;
16 /

However, use this with caution as it means the trigger runs in it's own transaction.

For more info see:
http://asktom.oracle.com
and search for "Autonomous Transactions"
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform