Shell Script to execute DB2 Stored Procedure
Posted: Tue May 13, 2008 1:27 pm
I have a DB2 Stored Procedure that takes input parameter and returns me result set (5 columns ) from cursor. I am able to connect to DB2 Server from my UNIX BOX and run the stored procedure and I get the resultset on my screen. Below is what I do:-
source /mycomp/thisproj/proj/Ascential/DataStage/DSEngine/dsenv
~db2inst1/sqllib/bin/db2
Connect to db2dsn user DB2SPUSER using pass@#45;
CALL SYSPROC.MYSTPROC(?,?,?,?,'U');
I want to write a SHELL SCRIPT that I want to execute and it should save the output data into a TEXT file on my UNIX Server
(1) How do I write a SHELL SCRIPT to do the above steps.
(2) How do I save all my output data into a TEXT file that I will read in my
next job
source /mycomp/thisproj/proj/Ascential/DataStage/DSEngine/dsenv
~db2inst1/sqllib/bin/db2
Connect to db2dsn user DB2SPUSER using pass@#45;
CALL SYSPROC.MYSTPROC(?,?,?,?,'U');
I want to write a SHELL SCRIPT that I want to execute and it should save the output data into a TEXT file on my UNIX Server
(1) How do I write a SHELL SCRIPT to do the above steps.
(2) How do I save all my output data into a TEXT file that I will read in my
next job