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

Home -> Community -> Mailing Lists -> Oracle-L -> create trigger after insert

create trigger after insert

From: Suhen Pather <Suhen.Pather_at_strandbags.com.au>
Date: Thu, 01 Nov 2001 19:49:21 -0800
Message-ID: <F001.003BB052.20011101194517@fatcity.com>

<span style='font-size:10.0pt;

font-family:Arial'>List,

<span style='font-size:10.0pt;

font-family:Arial'> 

<span style='font-size:10.0pt;

font-family:Arial'>I am creating a trigger that should fire when records are inserted into a table TEST and should send an email via

<span

style='font-size:10.0pt;font-family:Arial'>utl_smtp.<font face=Arial> 
The mailing is working fine.

<span style='font-size:10.0pt;

font-family:Arial'> 

<span style='font-size:10.0pt;

font-family:Arial'>I am trying to get the trigger to fire after <span class=GramE>a group insert statement rather than each time a record is inserted.

<span style='font-size:10.0pt;

font-family:Arial'>I have not included the "for each row" syntax but it still fires after each row is inserted.

<span style='font-size:10.0pt;

font-family:Arial'> 

<span style='font-size:10.0pt;

font-family:Arial'>Will the entry below be regarded as one insert statement if I put into a sql script and execute via sqlplus.

<span style='font-size:10.0pt;

font-family:Arial'> 

<span

style='font-size:10.0pt;font-family:Arial'>insert<font face=Arial> into test values ('Suhen');

<span

style='font-size:10.0pt;font-family:Arial'>insert<font face=Arial> into test values ('Suhen');

<span

style='font-size:10.0pt;font-family:Arial'>insert<font face=Arial> into test values ('Suhen');

<span

style='font-size:10.0pt;font-family:Arial'>insert<font face=Arial> into test values ('Suhen');

<span style='font-size:10.0pt;

font-family:Arial'> 

<span style='font-size:10.0pt;

font-family:Arial'> 

<span style='font-size:10.0pt;

font-family:Arial'> 

<span style='font-size:10.0pt;

font-family:Arial'>My create trigger syntax used:

<span style='font-size:10.0pt;

font-family:Arial'> 

<span

style='font-size:10.0pt;font-family:Arial'>create<font face=Arial> or replace trigger test_trigger after insert on test

<span

style='font-size:10.0pt;font-family:Arial'>begin<font face=Arial>

<span style='font-size:10.0pt;

font-family:Arial'>send_mail
('Suhen','suhen.pather_at_strandbags.com.au','Insert','Records inserted into test');

<span

style='font-size:10.0pt;font-family:Arial'>end<font face=Arial>;

<span style='font-size:10.0pt;

font-family:Arial'>/

<span style='font-size:10.0pt;

font-family:Arial'> 

<span style='font-size:10.0pt;

font-family:Arial'>I am busy looking through the docs for more info.

<span style='font-size:10.0pt;

font-family:Arial'> 

<span style='font-size:10.0pt;

font-family:Arial'>Any help would be greatly appreciated.

<span style='font-size:10.0pt;

font-family:Arial'> 

<span style='font-size:10.0pt;

font-family:Arial'>Regards

<span style='font-size:10.0pt;

font-family:Arial'>Suhen

<span style='font-size:10.0pt;

font-family:Arial'>  Received on Thu Nov 01 2001 - 21:49:21 CST

Original text of this message

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