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: I want to know information about the session which updates a certain table

Re: I want to know information about the session which updates a certain table

From: Rauf Sarwar <rs_arwar_at_hotmail.com>
Date: 17 Nov 2004 10:23:15 -0800
Message-ID: <92eeeff0.0411171023.2f92fc4f@posting.google.com>


> > USERENV('SESSIONID') returns the unique session id of the logged on
> > user which maps to v$session.audsid. So to get to the actual logged on
> > session you can,
> >
> > select *
> > from v$session
> > where audsid = userenv('SESSIONID');
> >
> > Regards
> > /Rauf
>
>
> I don't think you should be encouraging use of "userenv", unless I
> missed an Oracle version from the OP. SYS_CONTEXT is the way to go.
>
> Regards
> HJR
Thanks for the wake up call Howard.
In my own defense... OP's version is 9i so USERENV will still work as suggested in previous post but you are correct... SYS_CONTEXT is the "new" recommended way so it should read as,

select *
from v$session
where audsid = sys_context('USERENV', 'SESSIONID');

Regards
/Rauf Received on Wed Nov 17 2004 - 12:23:15 CST

Original text of this message

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