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: What's wrong with this trigger?

Re: What's wrong with this trigger?

From: Klaus Zeuch <KZeuchnospam_at_hotmail.com>
Date: Wed, 16 Aug 2000 09:20:21 +0200
Message-ID: <8ndhbg$5j8$1@papyrus.erlm.siemens.de>

In the case of updating with update...set.. statement you will run into ora-04091 mutating table error - you try to update picture-table that is currently being modified by the update-statement that fired the trigger: not possible

Yong <yk-park_at_fkl.fujitsu.co.kr> schrieb in im Newsbeitrag: 8nd7gn$23h$1_at_news.nuri.net...
> I think below trigger can do work when inserting.
> but on updating, ":new.pic_id" in where statemnet is not fixed.
> thus nothing happen.
>
> so you had better divide this trigger.
>
> if inserting then
> ----
> ----
> else
> ----
> ----
> end if;
>
>
>
> Helen <helen_kuo_at_us.sina.com>ÀÌ(°¡) ¾Æ·¡ ¸Þ½ÃÁö¸¦
> news:8ncnfh$s2s$1_at_newsmaster.cc.columbia.edu¿¡ °Ô½ÃÇÏ¿´½À´Ï´Ù.
> > I could create this trigger, but it didn't do what I wanted. Thanks for
 your
> > input.
> >
> > CREATE OR REPLACE TRIGGER pic_trg_aiur BEFORE INSERT OR UPDATE
> > OF status_yn ON picture
> > FOR EACH ROW
> >
> > BEGIN
> > IF :new.status_yn = 'Y' THEN
> > UPDATE picture
> > SET pic_ob = empty_blob()
> > WHERE pic_id = :new.pic_id;
> > END IF;
> > EXCEPTION
> > ..
> > END;
> > /
> >
> > H
> >
> >
>
>
Received on Wed Aug 16 2000 - 02:20:21 CDT

Original text of this message

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