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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Statement-Level Trigger Puzzle

Re: Statement-Level Trigger Puzzle

From: TommCarr <tommcarr_at_aol.com>
Date: 1997/07/08
Message-ID: <19970708235301.TAA22868@ladder02.news.aol.com>#1/1

You sound as if you are confused by the statement level trigger. There is no such thing as a transaction level trigger. Take the following statement for example:

Update table1
set somecol = somevalue
where anothercol like 'XY%';

This statement could cause any number of rows to be modified. Lets say that there will be 10 rows affected. You may define four separate triggers that will execute in the following order:

trigger1 fires once and only once before any modifications take place. trigger2 fires ten times, once before each record is changed. trigger3 fires ten times, once after each record has been changed. trigger4 fires once and only once after all modifications have taken place.

The execution order would be 1, 2, 3, 2, 3, 2, 3, ..., 2, 3, 4.

If you have the Oracle Server Concepts manual (don't leave home without it!), then read chapter 15. It will tell you everything (well...) you wanted to know about triggers. Hope this helps.

Tomm Carr
In giving freedom to the slave we assure freedom to the free, honorable alike in what we give and what we preserve. ---- Abraham ByGod Lincoln Received on Tue Jul 08 1997 - 00:00:00 CDT

Original text of this message

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