Re: With SQLPLUS, how to get an environment variable ?

From: John P. Higgins <jh33378_at_deere.com>
Date: 1996/10/22
Message-ID: <326D2E24.6423_at_deere.com>#1/1


Jean-Marc LHABITANT wrote:
>
> I wonder how, within SQLPLUS, to get an UNIX environment
> variable such as $HOME ?
>
> For example :
>
> export MYENVAR='My UNIX environment variable'
>
> sqlplus
>
> ....
>
> SQL> select <fields> from <table> where <field>=$MYENVAR
>
> If you know how to do this, please tell me !
>
> thanks
>
> Jean-MarcSure. Just do it like this:

export MYENVAR='My UNIX environment variable' sqlplus <<EOF
userid/password
select <fields> from <table> where <field>=$MYENVAR exit
EOF The <<EOF makes the lines that follow into stdin all the way up to a line that has just EOF. The trivk is that the shell processes the lines and expands the variables before sqlplus sees them.

-- 
John P. Higgins      Voice:    (309)765-4481
Deere & Company      Fax:      (309)765-5168
John Deere Road      Internet: jh33378_at_deere.com
Moline, IL 61265     Opinions: My Own
Received on Tue Oct 22 1996 - 00:00:00 CEST

Original text of this message