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.
Calling a shell script from within a DB2 9.1 stored procedure
Hi guys,
I am trying to translate some functionality from Oracle to DB2 9.1 and was wondering if any of you DB2 gurus out there could give me a hand. I need to call a command line application from within a DB2 stored procedure and wait for the application to finish before the stored procedure continues. In Oracle we call a Java procedure from within an Oracle stored procedure to achieve this and I was wondering if the same is possible within DB2?
I have been doing some reading up on this and it looks like it may be possible to do this using SQLJ, however finding information on how exactly to do this is proving to be very difficult. If you could reply with maybe a very basic example of how this could be achieved (some sort of Hello World example if possible) I would very much appreciate it.
Thanks for your reply....I just have one more question. I need to be able to call the java procedure from a normal bog standard sql procedure and wait until there is a return from the java procedure before continuing with the initial procedure. Something like this.....
1) Start initial procedure
2) Call the java procedure from within the initial procedure
3) Wait until the java procedure has returned
4) Complete the initial procedure.
Im sorry to be a pain, however I am very new to DB2 and have not been able to find this exact solution anywhere on the net. I am guessing that the DB2 community is either very quiet, very small, or both :-)
Sorry, I don't see any question in your second post. A Java stored procedure is invoked in the same manner as an SQL stored procedure. Obviously, you can call one SP from another - that's standard SQL, to which, by the way, DB2 adheres more strictly than Oracle...