Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> mutating table
I don't get it, I thought that I would get a mutating table error if I
tried to update the table on which I created my trigger. In the
following trigger I'm updating an different table yet I'm still getting
the 'mutating table' error.
Can anyone help?!?
The trigger is on repair_equipment the update on repair_transaction.
Thanx
Gates
CREATE OR REPLACE TRIGGER REPAIR1
AFTER UPDATE OF returned_dt ON repair_equipment
FOR EACH ROW
DECLARE
x NUMBER;
BEGIN
SELECT COUNT(*) INTO x FROM repair_transactions, repair_equipment
WHERE repair_transactions.repair_trans_id = :new.repair_trans_id AND repair_transactions.repair_trans_id = repair_equipment.repair_trans_id AND Returned_Dt IS NULL; IF x = 0 THEN UPDATE repair_transactions SET closed_dt = SYSDATE WHERE repair_trans_id = :new.repair_trans_id;END IF;