Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: PL/SQL question
In article <944ddj$vnv$1_at_nnrp1.deja.com>,
pehaw_at_my-deja.com wrote:
> what about the getvar procedure in the tool_env package:
>
> "This procedure provides a way to import an environment variable into
a
> VARCHAR2 variable.
>
> Example:
>
> Suppose you have a procedure that needs the current user's userid. You
> could include the following PL/SQL statement using TOOL_ENV.GETVAR:
>
> TOOL_ENV.GETVAR('USER', :userid);"
>
> In article <944b7n$toe$1_at_nnrp1.deja.com>,
> Mark D Powell <markp7832_at_my-deja.com> wrote:
> > In article <941t97$cpp$1_at_news.mch.sbs.de>,
> > "Jorge" <jjfernando_at_elasa.siemens.es> wrote:
> > > Hello:
> > >
> > > Could you help me with the next PL/SQL question ?
> > >
> > > I need to read enviroment variables from a PL/SQL program.
> > > This PL/SQL program is a stored procedure in a Oracle database.
> > >
> > > How could I do it ?
> > >
> > > Thanks in advance
> > > Bye.
> > > Jorge
> > >
> > To read OS environment variables via a stored pl/sql procedure would
> > probably require you to resort to using an external procedure or
> > perhaps java code. I believe that java has access to certain
> > environment features, such as you can get the IP address of the
client
> > process in java.
> >
> > Depending on what you actually need to know there are a couple of
> > tricks you might be able to use without resorting to using an
external
> > procedure. If the OS environment variables are for the db server or
> > the same for all clients you could create an OS process that writes
the
> > variables to a file and then use the utl_file package to read this
> > file. The client application could also be designed pass these
> > variables into Oracle using the dbms_application_info package
message
> > area or anonymous transactions into a OS session variable table on
> > startup.
> >
> > --
> > Mark D. Powell -- The only advice that counts is the advice that
> > you follow so follow your own advice --
> >
I am unfamiliar with the package and a grep -i on tool_env in the
$ORACLE_HOME/rdbms/admin directory for version 8.1.6 failed to find any
reference to the package. What version of Oracle does it come with?
-- Mark D. Powell -- The only advice that counts is the advice that you follow so follow your own advice -- Sent via Deja.com http://www.deja.com/Received on Thu Jan 18 2001 - 07:51:46 CST
![]() |
![]() |