Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Piping SQL into AIX script

Status
Not open for further replies.

BrianTyler

IS-IT--Management
Jan 29, 2003
232
GB
In AIX scripts I use:

print "Job Start" > $LOGFILE
db2 -t -s +v +p connect to $DB2DBDFT ;
db2 -t -s +v -x -z$REPFILE +p <<SQL >> $LOGFILE;
Select col1,col2 ... from table
;
SQL
print "Job Complete" >> $LOGFILE

This usually works fine, but sometimes DB2 doesn't stop at the correct point but tries to use the final print command as more sql, and gives me:

DB21007E End of file reached while reading the command

Is this an AIX problem or a DB2 problem ?
 
Check to see whether you have put a ';' at the end of SQL statement.
Good luck
ifxtechie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top