Re: Recursive Triggers

From: Jonathan W. Ingram <jingram_at_spam.less.teleport.com>
Date: 1998/04/02
Message-ID: <3522de83.30084110_at_news.teleport.com>#1/1


On Tue, 31 Mar 1998 20:18:00 -0500, Marty Manix <manixm_at_ix.netcom.com> wrote:

>I have a table structure that uses a parent/child relationship. A
>record can have a parent which is the primary key of that parent. The
>record at the top of the tree has no parent.
>
>I would like to have updates to a child record be reflected or rolled up
>to each of the parent records above the record being updated. I had
>hoped to use an update database trigger that only updates the parent,
>which will re-fire the trigger to update the parent's parent, etc. Kind
>of like a recursive firing of the trigger until the record no longer has
>a parent.
>
>I keep getting errors of the ilk... Table is mutating; trigger or
>procedure may not know of changes.

I'm not certain what type of application your developing, but it sounds as if you're duplicating data in parent and detail records. If you don't absolutely need to do so, I would avoid it because it leads to problems just like this.

Jonathan Received on Thu Apr 02 1998 - 00:00:00 CEST

Original text of this message