Trigger to update triggering table
From: Kenneth Nyman <knyman_at_hotmail.com>
Date: Mon, 13 Aug 2001 14:35:05 +0300
Message-ID: <9l8e19$hks$1_at_news.kolumbus.fi>
Date: Mon, 13 Aug 2001 14:35:05 +0300
Message-ID: <9l8e19$hks$1_at_news.kolumbus.fi>
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
On activation I get the following error:
ORA-04091: table KENNY.MEDI_CALLS is mutating, trigger/function may not see
it
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;
/
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 Mon Aug 13 2001 - 13:35:05 CEST