Re: Trigger to update triggering table
Date: 16 Aug 2001 06:24:19 -0700
Message-ID: <8daca8eb.0108160524.75a3faff_at_posting.google.com>
Other ways:
- Write a function return the max(call_nr), then in your trigger to call this function such as BEGIN :new.call_nr :=YOUR_FUNCTION; end;
- Use a procedure to to the insert.
- Use stage table.
?????
> > Hi!
> >
> > I'm trying to create a trigger that retrieves information from the same
> > table which activates the trigger.
> >
> > CREATE TRIGGER bi_increment_calls BEFORE INSERT
> > ON medi_calls FOR EACH ROW
> > BEGIN
> > SELECT NVL(MAX(call_nr),0)+1
> > INTO :new.call_nr
> > FROM medi_calls
> > WHERE tel_nr = :new.tel_nr AND
> > prefix = :new.prefix;
> > END;
> > /
> >
> > On activation I get the following error:
> >
> > ORA-04091: table KENNY.MEDI_CALLS is mutating, trigger/function may not see
> > it
> > ORA-06512: at "KENNY.BI_INCREMENT_CALLS", line 2
> > ORA-04088: error during execution of trigger 'KENNY.BI_INCREMENT_CALLS'
> >
> > There has to be a way to do this.. please help. :)
> >
> > /Kenny
Received on Thu Aug 16 2001 - 15:24:19 CEST