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

From: Odd Harry Ophaug <odop_at_osl.ifsab.se>
Date: 1996/10/23
Message-ID: <326E19A8.342F_at_osl.ifsab.se>#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-Marc

You could try something like this:

SQL>
SQL> host echo "DEFINE MYENVAR=$MYENVAR" > a.tmp
SQL> start a.tmp
SQL> host rm $HOME/sqlprompt.tmp
SQL> select <fields> from <table> where <field>=&MYENVAR 

Odd Harry Received on Wed Oct 23 1996 - 00:00:00 CEST

Original text of this message