sqlplus: not found

Hi All ,
At the end I have to post my problem thinking I'll be able to get a clue.

I have done a shell script to access a table in our database to extract some logs .
Script is working when executed manually ,but when I set it up in cronjob it is not working. I know thins should be a environment issue but i cant correct it .I red some posts and did some adjustments to the script but still not successful.

My script is -
----------------------------------

#!/usr/bin/ksh

set -x

#export ORACLE_SID=ictprd
#export ORACLE_BASE=/opt/apps/oracle/product
#export ORACLE_HOME=${ORACLE_BASE}/10204
#export NLS_DATE_FORMAT='DD-MON-YYYY'
#export NLS_DATE_LANGUAGE=AMERICAN
#export NLS_LANG=AMERICAN_AMERICA.WE8ISO8859P15
#export TNS_ADMIN=${ORACLE_HOME}/network/admin
#export ORACLE_OWNER="oracle"
#export ORACLE_LIB_DIR=lib


mlidd="emailadd@xxx.com"

prvdate=`cat pdate.log`

sdate=`date "+%Y/%m/%d %T"`

echo $sdate > pdate.log

. ${HOME}/.profile

sqlplus -s  yyyyy/dddd@xxx <<EOF

SET HEAD OFF 
SET FEEDBACK OFF
SET ECHO OFF
SET PAGESIZE 10000
SET TERMOUT ON
SET WRAP OFF
SET LINESIZE 500

spool msglg.log

SELECT *****
WHERE time_logged BETWEEN to_date('$prvdate','yyyy/mm/dd hh24:mi:ss') AND to_date('$sdate','yyyy/mm/dd hh24:mi:ss') AND fk_seve <= 8 ;
spool off
exit 
EOF

if [[ -s msglg.log ]] ; then 
cat msglg.log | mailx -s "CRITICAL AND ERROR  MESSAGE" $mlidd 
fi
rm msglg.log
exit

--------------------------

when i redirect script output from cron it says "sqlplus not found"

thanks

To keep the forums high quality for all users, please take the time to format your posts correctly.

First of all, use Code Tags when you post any code or data samples so others can easily read your code. You can easily do this by highlighting your code and then clicking on the # in the editing menu. (You can also type code tags

```text
 and 
```

by hand.)

Second, avoid adding color or different fonts and font size to your posts. Selective use of color to highlight a single word or phrase can be useful at times, but using color, in general, makes the forums harder to read, especially bright colors like red.

Third, be careful when you cut-and-paste, edit any odd characters and make sure all links are working property.

Thank You.

The UNIX and Linux Forums

My script is working , no issues