Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> mutating table

mutating table

From: Gates <twofourblue_at_yahoo.com>
Date: Tue, 10 Aug 1999 15:29:28 -0400
Message-ID: <37B07D98.55C80B04@yahoo.com>


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;
END;
/ Received on Tue Aug 10 1999 - 14:29:28 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US