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

Home -> Community -> Usenet -> c.d.o.tools -> Re: mutating table with trigger

Re: mutating table with trigger

From: Yong <yk-park_at_fkl.fujitsu.co.kr>
Date: Fri, 18 Aug 2000 10:14:28 +0900
Message-ID: <8ni2kq$84g$1@news.nuri.net>

 the mutating error is happened when using row trigger. your trigger also is designed to touch the mutating table. thus won't work properly.

usually, the statement trigger is not concernaed with mutating error.

so, you can solve this problem using below method.

i) before statement trigger. ( creation of table variables ) ii) after row trigger ( inserting values(uquestion) into that tables )
iii) after statement trigger. ( inserting values of table variables into table column )

<rlomasky_at_wellesley.edu>ÀÌ(°¡) ¾Æ·¡ ¸Þ½ÃÁö¸¦ news:8nhjvi$pit$1_at_nnrp1.deja.com¿¡ °Ô½ÃÇÏ¿´½À´Ï´Ù.
> I get a table mutating when I try to insert rows into this table. I
> have not been able to fix it.
>
> Can anyone help me with this, please?
>
> Thanks,
> Rachel
>
>
> AFTER INSERT ON technosurveyuquestionrelation
> FOR EACH ROW
>
> DECLARE
> i number(2);
> uquestion varchar2(10);
>
> BEGIN
> i := 2;
>
> while i <= length(:new.vctechnouquestionid) and not
> (substr(:new.vctechnouquestionid ,i + 1, 1) >= chr(57) and
> substr(:new.vctechnouquestionid ,i, 1) < chr(57))
> loop
> i := i + 1;
> end loop;
>
> uquestion := substr(:new.vctechnouquestionid , 1, i);
>
> UPDATE technosurveyuquestionrelation SET vctechnouquestionid =
> uquestion
> WHERE vctechnosurveyid = :new.vctechnouquestionid
> AND vctechnoquestionid = :new.vctechnouquestionid;
>
> END;
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Received on Thu Aug 17 2000 - 20:14:28 CDT

Original text of this message

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