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: Daniel Morgan <dmorgan_at_exesolutions.com>
Date: Wed, 08 May 2002 15:39:26 GMT
Message-ID: <3CD946A5.9A487797@exesolutions.com>


Knut Talman wrote:

> clueless 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.
>
> The view v$mystat shows your SID. Knowing it you can query v$session to get the
> os user.
>
> Regards,
>
> Knut

Good I can post this twice in one day:

SELECT osuser
INTO x
FROM v$session
WHERE sid = (

   SELECT sid
   FROM v$mystat
   WHERE rownum = 1);

;-)

Daniel Morgan Received on Wed May 08 2002 - 10:39:26 CDT

Original text of this message

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