The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 10-14-2008
regnumber regnumber is offline
Registered User
  
 

Join Date: Oct 2008
Posts: 9
how to get SQLCODE ?

Suppose I am executing a sql query thru shell script.
DB : IBM DB2

Quote:
db2 "select * from table1 with ur"
If none of the rows are fetched, I will be getting the sql code as 100
If rows > 0 are fetched, I will be getting the sqlcode as 0

Can any one help me how to get this SQL code in unix shell script (in KSH)

Krishnakanth