If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > DB2 trigger question

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-07-09, 09:58
ssamant01 ssamant01 is offline
Registered User
 
Join Date: Jan 2009
Posts: 3
DB2 trigger question

Can I use multiple BEGIN ATOMIC/END statements in a single trigger? e.g.
BEGIN ATOMIC
statement1;
END
BEGIN ATOMIC
statement2;
END

The reason I am asking is I have two different actions that need to take place from the trigger and I want them to be independent of each other e.g. if first one fails then the second one should execute. And if yes, then does the Syntax look ok?
Any help on this would be greatly appreciated.

Thank you.

Last edited by ssamant01; 01-07-09 at 10:19.
Reply With Quote
  #2 (permalink)  
Old 01-07-09, 10:16
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
The way I read the SQL syntax diagrams, No.

Andy
Reply With Quote
  #3 (permalink)  
Old 01-07-09, 10:27
ssamant01 ssamant01 is offline
Registered User
 
Join Date: Jan 2009
Posts: 3
Is there any way to do what I am trying to accomplish? I have one INSERT statement in the trigger that writes to a table. I need to modify the trigger to add another insert statement that would write to a different table. I want those two actions independent of each other i.e. even if the first one fails the second one should still execute.

Thanks.
Reply With Quote
  #4 (permalink)  
Old 01-07-09, 10:28
ssamant01 ssamant01 is offline
Registered User
 
Join Date: Jan 2009
Posts: 3
Is there any way to do what I am trying to accomplish? I have one INSERT statement in the trigger that writes to a table. I need to modify the trigger to add another insert statement that would write to a different table. I want those two actions independent of each other i.e. even if the first one fails the second one should still execute.

Thanks.
Reply With Quote
  #5 (permalink)  
Old 01-07-09, 10:55
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Starting with v9, you can call a stored procedure from a trigger.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On