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: Roman Mirzaitov <rmirzaitov_at_kt.kg>
Date: Fri, 10 May 2002 09:07:06 +0600
Message-ID: <abfdgn$hqrl9$1@ID-127142.news.dfncis.de>


Hi,

that's good.
You can use something like:

create or replace procedure test is
v_osuser varchar2(30);
begin
  select sys_context('USERENV','OS_USER')   into v_osuser
  from dual;
end test;

Regards,

--
Roman Mirzaitov
Brainbench MVP for Oracle Administration
www.brainbench.com


"clueless" <ro_cright_at_hotmail.com> wrote in message
news:7EaC8.20779$f5.1693383_at_news...

> oracle 8.1.7 on W2K
> "Roman Mirzaitov" <rmirzaitov_at_kt.kg> wrote in message
> news:abb9qj$gs76u$1_at_ID-127142.news.dfncis.de...
> > Hi,
> >
> > select sys_context('USERENV','OS_USER') from dual;
> > OS_USER - returns the operating system username of the client process
that
> > initiated the database session.
> > However, ability to use sys_context function depends on your Oracle
> version.
> > And as always you forgot to mention it.
> >
> > Regards,
> > --
> > Roman Mirzaitov
> > Brainbench MVP for Oracle Administration
> > www.brainbench.com
> >
> > "clueless" <ro_cright_at_hotmail.com> wrote in message
> > news:LB9C8.20757$f5.1692498_at_news...
> > > 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
> > >
> > >
> >
> >
> >
Received on Thu May 09 2002 - 22:07:06 CDT

Original text of this message

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