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

From: Ken Brouillette <kabroui_at_obelisk.plk.af.mil>
Date: 1996/10/22
Message-ID: <326D3D0A.1AF5_at_obelisk.plk.af.mil>#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

Not sure you can do it this way, but you might try something like this:

sqlplus username/passwd _at_script_name `echo $PATH`

then in your script put something like this

select <fields> from table where field = $1

$PATH gets passed to the variable $1 in this case.

Hope this helps.

Ken Brouillette
Database Adminstrator
Computer Sciences Corp.
Phillips Laboratories, Albuquerque NM Received on Tue Oct 22 1996 - 00:00:00 CEST

Original text of this message