Re: Question: Mutation in Statement Triggers

From: Jonathan Wayne Ingram <jwingram_at_whale.st.usm.edu>
Date: 1995/05/31
Message-ID: <3qi7or$gel_at_server.st.usm.edu>#1/1


Salaam Yitbarek (bi495_at_FreeNet.Carleton.CA) wrote:

: Hello,
: I wonder if anyone can help me with the following
: problem:
: Table 'b' has a statement trigger 't' associated with
: it that does a query on 'b'. When there is an insert,
: delete or update on 'b', the trigger executes properly.
: Table 'b' has a parent table 'a'. The reference from
: 'b' to 'a' is set to ON DELETE CASCADE. When a row
: in 'a' is deleted, and Oracle runs off to delete the
: corresponding rows in 'a', it returns an error saying
: that 'b' is mutating, and thus it cannot execute
: the trigger 't'. Any idea why?
Yes, because not only is table a being altered, but the index on table b is being altered because a has been changed. Solution: 1) Remove your foreign key, replacing it  with another after statement trigger that has  similar functionality. 2) Beats the heck out of me.

My personal opinion is that Oracle took the cheap way out of the triggers -- I know the row has just been inserted, but it was ME that just inserted it, so why can't I read the table?

Jonathan Received on Wed May 31 1995 - 00:00:00 CEST

Original text of this message