Re: Another mutating table problem

From: Kevin P. Fleming <kfleming_at_access-laserpress.com>
Date: Thu, 04 Jun 1998 23:07:28 GMT
Message-ID: <357728B0.E3B3F4A7_at_access-laserpress.com>


You have to use a statement level AFTER INSERT trigger and it has to know how to do its job only once. The only solution I can think of off the top of my head is to add an additional column to the table, that would be used to identify rows inserted by a normal operation vs. rows inserted by the trigger. Then, the BEFORE INSERT trigger can be modified to only run WHEN (columnname is 0).

Jason Boesch wrote:
>
> I am trying to create a BEFORE INSERT trigger that not only modifies the
> new record, but also inserts additional records in the triggering table.
>
> I've read some other postings that suggest using a row level trigger to
> store the current values and then use a statement level trigger to
> insert the new values. I understand how they work., but I think this
> problem is different because I'm triggering INSERTs as the result of an
> INSERT (not an update).
>
> Since the statement level trigger is AFTER INSERT it starts inserting
> the newly created records over and over again, producing an endless loop
> and an error.
>
> Any ideas on how this can be done?
>
> Thanks!
>
> --
> Jason Boesch
> jgboesc_at_REMOVE-THISuswest.com
Received on Fri Jun 05 1998 - 01:07:28 CEST

Original text of this message