Mutating table error

From: Oliver Weishaar <oweishaar_at_phelpsdodge.com>
Date: 22 May 2002 15:43:19 -0700
Message-ID: <3fac8d9.0205221443.18467f48_at_posting.google.com>


I have a table that tracks events and event sequences (primary key is event_id, seq_id). When I do an insert, I need to determine if the sequence is min or max for the event, so I wrote a row-level insert trigger that does the following:

select min(seq_id), max(seq_id)
into v_min, v_max
from events
where event_id = :new.event_id

The problem is that since this is a row level insert trigger, I get an error stating that the events table is mutating. Is there a way in Oracle to get around something like this?

Any help is greatly appreciated. Received on Thu May 23 2002 - 00:43:19 CEST

Original text of this message