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 -> ORA-06512 error during trigger execution

ORA-06512 error during trigger execution

From: Sean Read <sread_at_ix.netcom.com>
Date: 1998/01/16
Message-ID: <01bd2275$fa3160e0$6c0e5c18@sean.tampabay.rr.com>#1/1

I am receiving the following error messages when my trigger fails. I thought the user would only see the ORA-20003 error but ORA-06512 and ORA-04088 are returned as well. Below are the error messages:

 ORA-20003: Cannot add or change record. Referential integrity rules  require a related record in table 'stfipstb'.  ORA-06512: at "ALMIS.TRIG_BIUD_AREATYPE1", line 8  ORA-04088: error during execution of trigger 'ALMIS.TRIG_BIUD_AREATYPE1'    

 Now here is my trigger code:  

 DECLARE RecordCount NUMBER;
 BEGIN  
/* PREVENT INSERTS AND UPDATES IF NO MATCHING KEY IN 'stfipstb' */
 IF (UPDATING AND :old.stfips != :new.stfips) OR INSERTING THEN

     SELECT COUNT(*) INTO RecordCount FROM stfipstb WHERE (stfipstb.stfips =
 :new.stfips);

     IF RecordCount = 0 THEN
         raise_application_error(-20003, 'Cannot add or change record. 
 Referential integrity rules require a related record in table  ''stfipstb''.');

     END IF;
 END IF;  
/* CASCADE UPDATES TO 'geog' */

 IF UPDATING AND :old.areatype != :new.areatype THEN

     UPDATE geog
     SET geog.areatype = :new.areatype
     WHERE geog.areatype = :old.areatype;
 END IF;  
/* CASCADE DELETES TO 'geog' */

 IF DELETING THEN
     DELETE FROM geog WHERE geog.areatype = :old.areatype;  END IF;
 END;    Why am I receiving an ORA-06512 error?  

Thanks for all your help!  

 Sean Received on Fri Jan 16 1998 - 00:00:00 CST

Original text of this message

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