The variable ERROR should contain either 0 or an integer, 0 being a success. When run it returns a Null value, consequently the if ${erro} test fails. Has anybody got any idea why an integer is NOt returbed from isql

AuCoAcDB=odw_dev
tablename=scruple
ERROR=$( print `${OCSBIN}/isql -U${DBUSER} -S${DBSVR} -P${DBPASS} -o ${LOGFIL} <<aho
use ${AuCoAcDB}
go
exec dbo.usp_truncate_table ${tablename}
go
aho
` | tee -a ${LOGFIL} | awk '{print $NF}' | cut -d')' -f1)

if [ ${ERROR} -ne ${SUCCESS} ]
then
echo "usp_truncate_table failed with error code ${ERROR}"
test ${INIT_ERROR} -gt ${rCode} && rCode=${INIT_ERROR}
fi

If any one can help i would be most grateful