| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> Returning Oracle Variable to the Shell
Greetings,
I'm trying to return a value from Oracle to a shell script. Here is an excerpt:
SysLog "Executing sqlplus -s User <$DB_USER>/<$ORAPASS>"
sqlplus -s $DB_USER/$ORAPASS <<ORA_EOF > ${MAILFILE} 2>&1
set echo on
begin
select to_date(run_date,'DD/MM/YYYY') + 1
into ${RUN_DATE}
from run_details;
end;
/
ORA_EOF
code=$?
SysLog "Got a run date of ${RUN_DATE} from Database"
if [ $code -ne 0 ] ; then
LogError "GetRunDate failed, code ($code)"
exit 1
fi
Problem: It does not populate the shell-variable $RUN_DATE from the database as I would expect. I want to get a value from the database and use it within my shell script. I'm missing something obvious here. (can this be done??).
Any help appreciated. Received on Tue Apr 17 2001 - 23:15:48 CDT
![]() |
![]() |