Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Referencing OS variables via SQL*Plus
Peter Chandler wrote:
>
> Hi
>
> Does anyone know of a method whereby you can call UNIX environment
> variables
> within an SQL*Plus session?
>
> Any advice / tips would be greatly appreciated.
>
> Cheers,
> Pete.
> xuk97_at_dial.pipex.com
Pete:
If you want the variable values as of the start of the SQL*Plus session, just write your script as a 'here script'. For example (ksh):
export SPOOL_FILE=$ORACLE_HOME/spool$(date)
sqlplus -s <<EOF
system/manager
spool $SPOOL_FILE
do your sql (you could include $ variables there, too)
spool off
exit
EOF (the EOF token could be anything as long as it matches <<EOF above
AND does not occur in column 1 of the script)
Received on Sun Nov 23 1997 - 00:00:00 CST
![]() |
![]() |