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 > RETURN_STATUS and CLP

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-23-04, 11:49
haburai haburai is offline
Registered User
 
Join Date: Dec 2003
Posts: 10
RETURN_STATUS and CLP

Hi,
how can I get RETURN_STATUS from procedure, when I make call in unix shell script.

I tried this:
db2 connect to $db user $user using $pwd
ret_status=`db2 call rpt.del_car\('q', 'q', 'q'\)`
db2 terminate
echo "return_status=$ret_status"

and output:
return_status=
"DEL_CAR" RETURN_STATUS: "1"
Reply With Quote
  #2 (permalink)  
Old 06-23-04, 12:52
J Petruk J Petruk is offline
Registered User
 
Join Date: Mar 2004
Location: Toronto, ON, Canada
Posts: 513
db2 -tvf myscript.sql >> $LOG_FILE
if [ "$?" = "0" ]
then
res="SUCCESS: SCRIPT ON $1 (`hostname`)"
else
res="FAILED: SCRIPT ON $1 (`hostname`)"
fi
__________________
--
Jonathan Petruk
DB2 Database Consultant
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