Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Triggers - Mutating Table

Re: Triggers - Mutating Table

From: Tornyi Lajos <ltornyi_at_alpha-consulting.hu>
Date: Wed, 30 Sep 1998 09:59:38 +0100
Message-ID: <3611F2FA.FC575ED7@alpha-consulting.hu>


There's no way to do any query against a table which is mutating. It doesn't matter if trying to query columns which didn't change. Mutating means that the table is in an inconsistent state (theoretically) so querys should be refused, because no query is allowed to read an inconsistent state.

Rishaal Jadoo wrote:
>
> Hi,
>
> I'm having a problem with the MUTATING_TABLE error in some of my triggers.
> The triggers fire on an UPDATE, and the select which raises the
> MUTATING_TABLE error does not read the columns being updated. For this
> reason, we wish to ignore the error.
>
> Currently I have successfully ignored the error by declaring an exception,
> doing :
>
> Begin
> Declare
> Mutating_Table EXCEPTION;
> PRAGMA EXCEPTION_INIT(Mutating_Table, -4091);
> Begin
>
> Begin
>
> SELECT col1, col2
> INTO host1,hos2
> FROM table_which_is_mutating;
>
> Exception
> When Mutating_Table Then
> NULL;
>
> End;
>
> Continues with processing here, but select above does NOT
> execute.
>
> End;
>
> I would like to know how to get the select to execute, even in the event of
> the mutating_table error being raised.
>
> Thanks.
Received on Wed Sep 30 1998 - 03:59:38 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US