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

Home -> Community -> Usenet -> c.d.o.server -> Re: Trigger Problems

Re: Trigger Problems

From: Tab Liao <tabliao_at_ms14.hinet.net>
Date: 1997/10/27
Message-ID: <630ob9$e8a@netnews.hinet.net>#1/1

I think that it was caused by 'BEFORE INSERT' in your trigger definition, because you can not reference :OLD.COLUMN in before-insert trigger, by the way , you don't have to put 'BEFORE INSERT' here , since you just want to handle the cascade update, don't you ?

"Sean Read" <sread_at_ix.netcom.com> wrote:

>I am having trouble creating the following UPDATE triggers:
 

>/* Trigger code */
>CREATE TRIGGER Trig_BIUD_geog1
>BEFORE INSERT OR UPDATE OR DELETE ON geog FOR EACH ROW
>DECLARE RecordCount NUMBER;
>BEGIN
 
>/* CASCADE UPDATES TO 'subgeog' */
>IF UPDATING AND :old.subareatyp != :new.areatype OR :old.substfips !=
>:new.stfips OR :old.subarea != :new.area THEN
>UPDATE subgeog
>SET subgeog.subareatyp = :new.areatype , subgeog.substfips = :new.stfips ,
>subgeog.subarea = :new.area
>WHERE subgeog.subareatyp = :old.areatype AND subgeog.substfips =
>:old.stfips AND subgeog.subarea = :old.area;
>END IF;
 
>/* CASCADE UPDATES TO 'subgeog' */
>IF UPDATING AND :old.areatype != :new.areatype OR :old.stfips !=
>:new.stfips OR :old.area != :new.area THEN
>UPDATE subgeog
>SET subgeog.areatype = :new.areatype , subgeog.stfips = :new.stfips ,
>subgeog.area = :new.area
>WHERE subgeog.areatype = :old.areatype AND subgeog.stfips = :old.stfips AND
>subgeog.area = :old.area;
>END IF;
>END;
 
>I am having a problem applying the first UPDATE trigger. It gives the
>following error:
 

>MGR-00072: Warning: TRIGGER TRIG_BIUD_GEOG1 created with compilation
>errors.
 

>I executed the command SHOW ERRORS and received the following message:
 

>5/17 PLS-00049: bad bind variable 'OLD.SUBAREATYP'
>5/53 PLS-00049: bad bind variable 'OLD.SUBSTFIPS'
>5/86 PLS-00049: bad bind variable 'OLD.SUBAREA'
 

>What does this mean and what can I do to fix this problem?
Received on Mon Oct 27 1997 - 00:00:00 CST

Original text of this message

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