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 > Executing an OS script from a db2 trigger

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-21-08, 04:21
ghosh_shibaji ghosh_shibaji is offline
Registered User
 
Join Date: Oct 2006
Posts: 11
Executing an OS script from a db2 trigger

Hi,

I am in a situation where I want to make a call and execute a script file (unix shell script) from a db2 trigger. It will be an after insert trigger which will execute the script after 4 rows are inserted into the table on which the trigger is based. Can someone provide me with a template where a script file sitting in an OS directory can be executed from a db2 trigger. Also, how do I tackle the call only after the fourth row is inserted. Can we reference the same table from a trigger on which a trigger is based on ?
Reply With Quote
  #2 (permalink)  
Old 07-21-08, 06:35
HachavBanav HachavBanav is offline
Registered User
 
Join Date: Jul 2008
Posts: 11
Your trigger may:
-Increment another table to handle the "4 insertion" detection
-Call a C or Java procedure that has been registered in DB2 (with CREATE PROCEDURE...EXTERNAL NAME 'libraryfilename!entrypointofyourProc')

Sorry, I am sure that works but I can not help any more...
__________________
To geek or not to geek !
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