I don't know the syntax with "WITH", only with "WHERE", etc.
If you db2 SQL query finds at least 1 row, the returncode of your command will be 0, if not it is 1 or at least > 0.
So you can work with testing $? or parse whatever SQL code you are getting by putting your command into a variable maybe like for example
Hello All,
I have 2 shell scripts.
script1.sh
script2.sh
script1.sh call script2.sh
script2 will connect to DB2 database and execute a insert statement. I am capturing the return value of insert statement in an variable called SQLCODE. I want to return this SQLCODE to the calling script... (0 Replies)