Re: Is there a workaround for the 'mutating table' problem in a trigger ?

From: Ken Denny <kedenny_at_mail.concentric.net>
Date: 1996/04/13
Message-ID: <4kmt07$7s9_at_tribune.concentric.net>#1/1


coolcat_at_citynet.net wrote:
>Hi
>
>In a trigger on a table, I want to do a
>SELECT MAX() ...
>from that table and update a denormalized column in another table.
>
>However, the table obviously mutates.
>
>I understand SYBASE has a workaround using which you can do a SELECT
>on the table on which the trigger is defined.
>
>Does ORACLE ?
>
>TIA.
>

The way I've handled it is in a "before insert or update or delete for each row" trigger I gather the information I need in a temporary table, then in an "after insert or update or delete" trigger (note without the "for each row" option. If you use "for each row" you will still get the table is mutating error) I read that temporary table and do whatever needs doing deleting the rows from the temporary table as I go.

I hope this helps
Ken Denny

-- 
 
 /|  / 
/ | /   _        _ 
  |<   / \    /|/ \
  | \  \ /   / |   \
  |  \__X___/  |    \___
Received on Sat Apr 13 1996 - 00:00:00 CEST

Original text of this message