Re: With SQLPLUS, how to get an environment variable ?
Date: 1996/10/28
Message-ID: <NEWTNews.846535962.24367.Mike_at_xmc0801mbehr.henr.mc.xerox.com>#1/1
In article <54pfv6$1gt_at_news.ipoline.com>, <axu_at_ipoline.com> writes:
> Path: rocksanne!parc!news.Stanford.EDU!agate!spool.mu.edu!munnari.OZ.AU!news.ecn.uoknor.edu!feed1.news.erols.com!howland.erols.net!mathserv.mps.ohio-state.edu!jussieu.fr!rain.fr!globalip.ch!imp.ch!sunqbc.risq.net!ipoline.com!usenet
> From: Aiwen Xu <axu_at_ipoline.com>
> Newsgroups: comp.databases.oracle
> Subject: Re: With SQLPLUS, how to get an environment variable ?
> Date: 25 Oct 1996 04:33:42 GMT
> Organization: InterPacific Online
> Lines: 16
> Message-ID: <54pfv6$1gt_at_news.ipoline.com>
> References: <lbphgnn9h3q.fsf_at_tholos.belfort.cnet.fr>
> NNTP-Posting-Host: pm5e25.ipoline.com
> Mime-Version: 1.0
> Content-Type: text/plain; charset=us-ascii
> Content-Transfer-Encoding: 7bit
> X-Mailer: Mozilla 1.1N (Windows; I; 16bit)
> To: lhabitan_at_belfort.cnet.fr
>
> Hi, Jean-Marc,
>
> You can just put the $MYENVAR at UNIX command line like:
>
> $ sqlplus username/password _at_sql_script $MYENVAR
>
> And in the sql_script.sql:
>
> select <fields> from <table> where <field>= '&1'
>
> Since the variable &1 is $MYENVAR, your select statement will get your UNIX
> environment variable. Hope it will help you.
>
>
> Aiwen
>
>
You could also try putting the whole thing in a shell script:
echo "username/password
select <fields> from <table> where <field>= `echo $MYENVAR`"|sqlplus -s
Mike. Received on Mon Oct 28 1996 - 00:00:00 CET