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

Home -> Community -> Usenet -> c.d.o.server -> Re: quick question about after statement triggers

Re: quick question about after statement triggers

From: Michel Cadot <micadot{at}altern{dot}org>
Date: Mon, 17 Oct 2005 20:51:47 +0200
Message-ID: <4353f2c3$0$4303$626a54ce@news.free.fr>

"Jack Addington" <jaddington_at_shaw.ca> a écrit dans le message de news: pZR4f.226350$tl2.108107_at_pd7tw3no...
| "Sybrand Bakker" <postbus_at_sybrandb.demon.nl> wrote in message
| news:o1q7l1d7p0cam42dug88r5hchdb1ii33lq_at_4ax.com...
| > On Mon, 17 Oct 2005 17:54:41 GMT, "Jack Addington"
| > <jaddington_at_shaw.ca> wrote:
| >
| >>If I have an after statement trigger defined as
| >>
| >>cREATE OR REPLACE TRIGGER some_table_aius
| >>after INSERT or update
| >>on some_table
| >>declare
| >>
| >>begin
| >>
| >> do_some_process( xxx );
| >>
| >>end;
| >>
| >>and then I do:
| >>
| >>insert into some_Table(...)
| >>insert into some_table (...)
| >>update some_table set xxx where yyy
| >>
| >>commit;
| >>
| >>will the do_some_process function fire twice, once for updates and once
| >>for
| >>inserts or just once?
| >>
| >>thx
| >>
| >>jack
| >>
| >
| > You have three distinct statements, so the trigger will fire 3 times.
| >
| > --
| > Sybrand Bakker, Senior Oracle DBA

|

| This is a statement trigger, not a row trigger.
|
|

This is exactly what Sybrand said you: 3 statements (insert+insert+update) -> 3 executions. If it was row level trigger there'ld be n+p+q executions (n rows inserted + p rows inserted + q rows updated).

Regards
Michel Cadot Received on Mon Oct 17 2005 - 13:51:47 CDT

Original text of this message

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