Have to call a DB2 stored procedure
Moderators: chulett, rschirm, roy
Have to call a DB2 stored procedure
I have a scenario, where in I am using a loop to execute a job 20 times with some different variable each time. I want to execute/call a DB2 stored procedure after end of the loop. How can I achieve this in parallel jobs?
Just execute it after the loop.
You can do this from the job sequence, by using ExecuteCommandActivity to call the SP from OS level. Or use a JobControl which has the db2 api stage (in the before/after sql tab) to call SP.
You can do this from the job sequence, by using ExecuteCommandActivity to call the SP from OS level. Or use a JobControl which has the db2 api stage (in the before/after sql tab) to call SP.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
Using commnad line interface.
Where "?" can be used for IN type.
Code: Select all
db2 "call StoredProcedure(100, ?)"
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
Don't forget that you also need to execute a "db2 connect ..." statement as well!
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
I am calling procedure using syntax---db2 "call test_proc()". But its giving following error:
TEST_PROC..JobControl (@Execute_Command_0): Executed: db2 "call svsods.test_proc()"
Reply=255
Output from command ====>
exec(): 0509-036 Cannot load program db2 because of the following errors:
0509-022 Cannot load module /db2home/db2inst3/sqllib/lib/libdb2.a(shr_64.o).
0509-150 Dependent module /usr/opt/db2_08_01/lib/libdb2osse.a(shr_64.o) could not be loaded.
0509-152 Member shr_64.o is not found in archive
0509-022 Cannot load module db2.
0509-150 Dependent module /db2home/db2inst3/sqllib/lib/libdb2.a(shr_64.o) could not be loaded.
0509-022 Cannot load module .
TEST_PROC..JobControl (@Execute_Command_0): Executed: db2 "call svsods.test_proc()"
Reply=255
Output from command ====>
exec(): 0509-036 Cannot load program db2 because of the following errors:
0509-022 Cannot load module /db2home/db2inst3/sqllib/lib/libdb2.a(shr_64.o).
0509-150 Dependent module /usr/opt/db2_08_01/lib/libdb2osse.a(shr_64.o) could not be loaded.
0509-152 Member shr_64.o is not found in archive
0509-022 Cannot load module db2.
0509-150 Dependent module /db2home/db2inst3/sqllib/lib/libdb2.a(shr_64.o) could not be loaded.
0509-022 Cannot load module .
The error message is telling you that the object
is either not there, has too little permissions for your user or for some other reason isn't accessible. Have you checked your UNIX permissions?db2home/db2inst3/sqllib/lib/libdb2.a(shr_64.o).
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
You need to be using the 32-bit libraries. DataStage is a 32-bit application. Make sure that, at least for your DataStage processes, the 32-bit libraries precede the 64-bit libraries in your shared library search path.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.