Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: reading unix host variables within PL/SQL
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:
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
![]() |
![]() |