Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2006
    Posts
    11

    Unanswered: 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 ?

  2. #2
    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 !

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •