Error not captured in log file in bteq using shell script

Database
Junior Supporter

Error not captured in log file in bteq using shell script

Hi,

I am facing a very wierd problem. I am running two "show sel * from dbname.tablename" query using bteq in a shell script and exporting to a file.

When i run this, i am using a log file to capture the status on the queries in shell script. One of the tables doesn't exist. So, when i run the shell script, i get an error on the unix promt from where i am running this. 

=====================

logname="mylog.`/bin/date '+%y%m%d%H%M%S'`.log"

bteq < /opt/idw/pr/dba_work/cmd/WIR_OSI2.btq >>$logname

===================== 

*** Failure 3807 Object 'abc.xyz' does not exist.

                Statement# 1, Info =0 

 *** Warning: EOF on INPUT stream.

But, when i go to the log file, i dont see this error captured. I just see :

show sel * from abc.xyz;

 *** Total elapsed time was 1 second.

I want to use the log file to find how many tables doesn't exist / other errors. 

I used a sel * from abc.xyz, but the situation is same.

A quick help is really appreciated.

Thanks !