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: selecting osuser info inside a stored proc

Re: selecting osuser info inside a stored proc

From: Marc Blum <marc_at_marcblum.de>
Date: Thu, 09 May 2002 18:44:15 GMT
Message-ID: <3cdac213.9142756@news.online.de>


Hi,

one more tip:
Don't use a standalone procedure. Better put it into a PL/SQL-package. In the initialisation section of the package, determine the osuser and put it into a private but global variable. The global variable is session-persistent! Your now packaged procedure just returns that variable. As the osuser won't change during one session, that's safe and much faster, if you use that function heavily (as we do).

hth

On Wed, 08 May 2002 13:19:39 GMT, "clueless" <ro_cright_at_hotmail.com> wrote:

>Hi gang,
>
> I am writing a pl/sql stored procedure. Inside the procedure I want to
>determine the osuser who is executing the stored proc. The user will NOT
>have dba privileges, i.e. this will be a NORMAL user. Any ideas, hints,...
>
> I was thinking about creating another stored function owner by a dba that
>would return the osusers from v$session when called (execute priv would be
>granted to the NORMAL user). The problem is that this view (v$session) will
>return all users logged in.
>
> Thanks,
>Clueless
>
>

regards
Marc Blum
mailto:marc_at_marcblum.de
http://www.marcblum.de Received on Thu May 09 2002 - 13:44:15 CDT

Original text of this message

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