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??
I found your post confusing. What command do you run that gives you the exit code of 1? The output you showed above is an unsuccessful fetch/update/delete because the table was empty. I would expect a 1 returned from such a script.
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".