Problems with Cron and isql

Dear Friends,

I am running a script which runs a select query from a sybase table and outputs the result (1 row) into a .txt file in unix. When I run the script manually it behaves normally. However it doesnt run in crontab.

#!/usr/bin/ksh
. /opt/ivb/config/set_env

/usr/sybase/bin/isql -Usa -Pxxxx -Dxxx -cgo -o corestats.txt <<EOT

set rowcount 1
SELECT
    cdf_trfsddsdsstats_tbl.date as Date, sum(cdf_trfstats_tbl.succ_count) FROM
    trfstats_tbl
WHERE
        cdf_trfstats_tbl.cp = 23
go
quit
EOT

 

Any help would be much appreciated.

Santosh.

Please show us the contents of set_env.