I have a shell script as below through which I'm connecting Sybase IQ through dbisqlc.
I would like to capture if there Error is any Error occurs during the Script Execution. I coded like below. But eventhough if there is any failure in SQL Execution , the Return Count in always 0.
dbisqlc -c "uid=UID;pwd=PWD;eng=DEV;links=tcpip(host=XXXX;port=XXX)" -q Query.sql OutputDumpFile
RC=`echo $?`
if [ $RC != 0 ]
then
echo "ERROR: Error in DB Query Execution"
fi
Please help how to capture the SQL Error in UNIX for Sybase IQ