Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Referencing OS variables via SQL*Plus

Re: Referencing OS variables via SQL*Plus

From: John P. Higgins <jh33378nospam_at_deere.com>
Date: 1997/11/23
Message-ID: <3479057D.7612@deere.com>#1/1

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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US