Re: return result to variable in script
From: Jared Still <jared_at_valleynet.com>
Date: 1995/11/09
Message-ID: <47stq7$7ld_at_alpine.valleynet.com>#1/1
Date: 1995/11/09
Message-ID: <47stq7$7ld_at_alpine.valleynet.com>#1/1
pyates_at_melb.cpr.itg.telecom.com.au (Peter Yates) wrote:
>How can I return a result into a variable in a script
>eg
>rem set variable here
>sqlplus scott/tiger <<SQLEOF
>set heading off
>set termout off
>select count(*) from table;
>what next???
>exit
>SQLEOF
>echo variable
>Thanx in advance
create a script "date.sql"
- date.sql
set feed off pause off echo off termout on pages 0
select sysdate from dual;
exit
- end of date.sql
from the unix command line: (those are back-quotes, not single quotes)
date=`sqlplus -s / _at_date`
echo $date
09-NOV-95
Jared Still, Oracle DBA
RxNet, Division of Value Health
"All opinions are mine, not my employers"
jared_at_valleynet.com
Received on Thu Nov 09 1995 - 00:00:00 CET