Re: After statement level trigger iring before after row level trigger

From: PeteDaMeat <peterlazell_at_gmail.com>
Date: Thu, 19 Mar 2009 03:18:56 -0700 (PDT)
Message-ID: <845da02e-c710-464a-b036-4d7e1e9d74bd_at_v15g2000yqn.googlegroups.com>



On Mar 19, 9:47 am, "Laurenz Albe" <inv..._at_spam.to.invalid> wrote:
> PeteDaMeat wrote:
> > I have a database table which has anafterstatementleveltrigger
> >firingbefore theafterrow leveltrigger, does anyone have any
> > suggestions as to what could be causing this?
>
> This is caused by the Oracle database engine.
> The behaviour is documented inhttp://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14220/tri...
>
> For enabled triggers, Oracle automatically performs the following actions:
>
>  * Oracle runs triggers of each type in a plannedfiringsequence when
>    more than onetriggeris fired by a single SQLstatement.
>    First,statementlevel triggers are fired, and then row level triggers are fired.
> [...]
>  * Oracle fires multiple triggers in an unspecified, random order, if more
>    than onetriggerof the same type exists for a givenstatement;
>    that is, triggers of the same type for the samestatementare
>    not guaranteed to fire in any specific order.
>
> Yours,
> Laurenz Albe

That is different to the documentation I have:

Oracle uses the following execution model to maintain the proper firing sequence of multiple triggers and constraint checking:

Run all BEFORE statement triggers that apply to the statement. Loop for each row affected by the SQL statement. Run all BEFORE row triggers that apply to the statement. Lock and change row, and perform integrity constraint checking. (The lock is not released until the transaction is committed.) Run all AFTER row triggers that apply to the statement. Complete deferred integrity constraint checking. Run all AFTER statement triggers that apply to the statement.

Pete Received on Thu Mar 19 2009 - 05:18:56 CDT

Original text of this message