Steven McGarva
Jul 20th, 2001, 09:28 AM
I have a Unix script which calls sql*plus to run a sql script, I want the sql script to return the single value (a character eg "A") from a select statement.
the UNIX script does this:
sqlplus -s login/password @$sqlfile/sqlScrip.sql
ret_val=$?
and
the SQL script does this:
set heading off
whenever SQLERROR EXIT 99
REM Only a single value in this Table.
select STATUS
from TBLINTERFACE_MESSAGE;
exit
but all I manage to capture is the exit code from sql*plus (ie 0 not "A"), not the value returned from the SQL select
can anyone help?
the UNIX script does this:
sqlplus -s login/password @$sqlfile/sqlScrip.sql
ret_val=$?
and
the SQL script does this:
set heading off
whenever SQLERROR EXIT 99
REM Only a single value in this Table.
select STATUS
from TBLINTERFACE_MESSAGE;
exit
but all I manage to capture is the exit code from sql*plus (ie 0 not "A"), not the value returned from the SQL select
can anyone help?