Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: reading unix host variables within PL/SQL

Re: reading unix host variables within PL/SQL

From: Muli Koppel <mkoppel_at_barakitc.co.il>
Date: 1997/06/17
Message-ID: <01bc7af2$73457f60$0b320089@dbasrv>#1/1

Hi,

I have a solution for you, that will give you the possibility to treat any Environment
variable as an sql (pl/sql) variable.

Follow these steps:

  1. connect to Sql*Plus
  2. run the following command

   SQL> HOST prepare_sql_env.csh :

            prepare_sql_env.csh is something like  

            #! /bin/csh -f
           
            env | awk '{ print "DEF " $1}' > sql_env.SQL

3. start (or @) sql_env.SQL

and that's it --> you have ALL your env variables defined in your current sql
session. These variables can be referenced by &&ENV within PL/SQL too!

do note - sometimes you must enclose &&ENV in apostrophs, i.e. '&ENV'

my answer holds for Oracle version 7.3, and lower if HOST is a recognized sql
command.

this will help you,

Muli Koppel

An Independent Senior DBA

rob joss <rob_joss_at_lilly.com> wrote in article <33A56776.6A6_at_lilly.com>...
> I have not been able to find a way of reading unix host variables from
> either SQLPLUS or within PL/SQL.
>
> Does anyone how to do this?
>
> Thanks
>
  Received on Tue Jun 17 1997 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US