Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Execute trigger on current row
In article <8qc48d$58c$10$1_at_news.t-online.com>,
"Stefan Grundmann" <s.grundmann_at_t-online.de> wrote:
> Answer embedded.
>
> Stefan.
>
> <bhavinsh_at_my-deja.com> schrieb in im Newsbeitrag:
> 8qc05v$flo$1_at_nnrp1.deja.com...
> > Hi,
> >
> > I'm trying to write a trigger that updates a date field
> > after an insert. However, I want to only update that
> > row's date field. I can't do a "where" qualification
> > because the fields they enter can vary.
> >
> > How would I update the field only for the inserted
> > row?
> >
> > Right now I have something like this which sets all the
> > dates in the table:
> > CREATE OR REPLACE TRIGGER CREATED_DATE AFTER INSERT ON
> > SOMETABLE
>
> FOR EACH ROW
>
> > begin
> > UPDATE SOMETABLE SET created = sysdate;
> > end;
> > /
> >
> > Is there an "on current row" qualification of some sort?
> >
> > Oracle 8.1.6
> >
> > TIA
The FOR EACH ROW yields an ora-4091:
table xxx is mutating, trigger/function may not see it
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Thu Sep 21 2000 - 00:00:00 CDT