![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| FTP Return Code | wilsonSurya | UNIX for Dummies Questions & Answers | 1 | 10-06-2008 07:27 AM |
| to pick up the Return Code ( RC) from the mailx command and return it to SAS uisng 's | manas6 | UNIX for Dummies Questions & Answers | 0 | 06-05-2008 06:44 AM |
| asking about return code | naamas03 | Shell Programming and Scripting | 3 | 08-28-2007 04:53 AM |
| Incorporte Return Code | u263066 | Shell Programming and Scripting | 2 | 09-06-2006 04:58 AM |
| Return Code of tar in AIX | dupeng | AIX | 3 | 02-23-2004 12:05 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Need help with return code 1...
Hi Guys,,
I am having a unix script which is running the DB2 Insert command. For the insert command, there were no records to be updated. SQL0100W No row was found for FETCH, UPDATE or DELETE; or the result of a query is an empty table. SQLSTATE=02000 + + echo 1 STAGE_RC=1 + [[ 1 != 0 ]] Because of this, it is returning return code as 1. My script will work, only if this part of the script is successful as u can see the in the code above. all 1 in the codes are return code. is it because of the DB2 insert statement or is it due to something else..When will the return code be 1?? |
|
||||
|
thanks otheus,, so in the case of no rows found for update or insert,, the return code willl be 1.. rite??
But the same script is running fine, for the other family codes which also shares the same scenario.. (No rows found for update or insert) could you please explain me that? |
|
|||||
|
Like I said, I would expect the return code from such a command to be 1. But since you did not post the command, I cannot possibly know. I probably wouldn't know anyway, since I have very little experience with DB2. I recommend you repost in the "Database" or "AIX" forums with "such-and-such command sometimes returns 1 on failure".
|
|
||||
|
This is the piece of code causing trouble.. otheus..
db2 "insert into table \ (col,,,,\ ) \ select * from tab1 a, tab2 b where\ a.id=b.id \ with ur" STAGESUM_RC=`echo $?` if [[ $STAGESUM_RC != "0" ]] ; then ReturntoParent $STAGESUM_RC "Error in Insert Fact Stage_Sum" fi db2 "commit" |
|
|||||
|
I doubt this will change anything, but it's better to change the first line to:
Code:
STAGESUM_RC=$? |
![]() |
| Bookmarks |
| Tags |
| return code 1 |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|