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 > Question on DB2 Trigger

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-13-09, 16:02
mrhrbacek mrhrbacek is offline
Registered User
 
Join Date: Oct 2007
Posts: 6
Question on DB2 Trigger

I would like to use a DB2 Trigger to launch a CICS transaction when a row is inserted into a table. However, if multiple rows are inserted, I don't want to launch it multiple times because once it is launched, it can detect and process all those multiple rows. Can DB2 Triggers work like MQ Triggers works, where you can set up to only do one trigger process as long as the queue still has messages (i.e only launch trigger on first insert if there are multiple)?

If not, I know I could set up the trigger to put a simple message to an internal queue, which in turn, is set up to trigger a process (transaction) that will be started on FIRST ONLY. (but I want to avoid if DB2 Trigger can do this).

I've done some reading on this, and I can't find enough detail to give me an answer either way.
Reply With Quote
  #2 (permalink)  
Old 11-13-09, 17:27
craigmc craigmc is offline
Registered User
 
Join Date: Aug 2003
Location: austin,tx
Posts: 90
You can define triggers to fire FOR EACH ROW or FOR EACH STATEMENT. FOR EACH STATEMENT is only valid for a BEFORE or INSTEAD OF trigger however.
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