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: Newbie: Update trigger

Re: Newbie: Update trigger

From: Alessandro Franchini <alessandro_at_franchini-net.com>
Date: Tue, 19 Nov 2002 09:48:57 +0100
Message-ID: <3dd9f658_2@corp.newsgroups.com>


Thank you it works.

Alessandro Franchini
"Paul Brewer" <paul_at_paul.brewers.org.uk> schrieb im Newsbeitrag news:3dd94d33_3_at_mk-nntp-1.news.uk.worldonline.com...
> "news.green.ch" <alessandro_at_franchini-net.com> wrote in message
> news:3dd89ad7$1_4_at_corp.newsgroups.com...
> > Hi everyone
> > my name is Alessandro and i'm new to this newsgroup.
> >
> > I have a simple problem. I would like in an update trigger to update a
> > timestamp and moduser field to take trace of the changes to a row.
> > But i having troubles because Oracle says the table is mutating.
> > The trigger is defined like that:
> > CREATE OR REPLACE TRIGGER FC_UTRICHIESTA_U_INFOS BEFORE UPDATE ON
> > IASTEST.FC_UTRICHIESTA
> > FOR EACH ROW
> > BEGIN
> > UPDATE FC_UTRICHIESTA SET MUTADATA = SYSDATE;
> > END;
> > /
> >
> > What i'm doing wrong or how can i solve my problem.
> >
> > Thanx in advance
> >
> > Alessandro Franchini
> >
> >
> >
> >
> > -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
> > http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
> > -----== Over 80,000 Newsgroups - 16 Different Servers! =-----

>

> Hi Allesandro,
>

> You are trying to update the whole table (update without a predicate).
>

> Try this:
> CREATE OR REPLACE TRIGGER FC_UTRICHIESTA_U_INFOS BEFORE UPDATE ON
> IASTEST.FC_UTRICHIESTA
> FOR EACH ROW
> BEGIN
> select sysdate, user into :new.mutadata, :new.mutauser from dual;
> END;
> /
>

> This will operate on the row you are working with.
>

> Regards,
> Paul
>
>
>
>
>




-----= Posted via Newsfeeds.Com, Uncensored Usenet News =----- http://www.newsfeeds.com - The #1 Newsgroup Service in the World! -----== Over 80,000 Newsgroups - 16 Different Servers! =----- Received on Tue Nov 19 2002 - 02:48:57 CST

Original text of this message

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