Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Use environment variable in SQLPlus on Windows
On Thu, 25 Jan 2007 20:47:27 +0100, Matthias Langbein
<matthias_langbein_at_web.de> wrote:
>Hi all,
>is there a way to use a environment variable in SQL PLus? On Linux I
>can use the $, but on Windows this doesn't work.
>
>Example:
>
>C:\> SET SQLOUT=C:\LOG\
>C:\> SQLPLUS scott/tiger
>
>SQL> SPOOL ${SQLOUT}TEST.LOG
>SQL> PROMPT A
>A
>SQL> SPOOL OFF
>SQL> EXIT
>
>
>This saves me the Log file in the current directory with the file name
>${SQLOUT}TEST.LOG, but I want the log file with the name TEST.LOG
>stored in the directore C:\LOG
>
>Any help??
>
>THX, Langi
Don't know, but a single google got this from
http://orafaq.com/node/515
In DOS scripts, %1, %2 and so on refer to the first, second, etc. values you
list on the command line after invoking the script. Likewise, &1, &2, etc.
refer to the first, second, etc. values you list on the command line after
invoking a SQL*Plus script.
so you might pass environmentals on the command line to sql*plus.
hth
Jeff
Jeff Kish
Received on Thu Jan 25 2007 - 13:59:51 CST
![]() |
![]() |