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: Find out session ID

Re: Find out session ID

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Tue, 08 Sep 1998 10:30:40 GMT
Message-ID: <3605070a.15904659@192.86.155.100>


A copy of this was sent to Bertalan GOMBOS <gombos_at_finit.hu> (if that email address didn't require changing) On Tue, 08 Sep 1998 10:17:55 +0200, you wrote:

>Hi All!
>
> It is possible to find out the current session ID from PL/SQL?
>
> Answers are welcome, bye:
> Bert

select userenv( 'sessionid' ) from dual

will give you the sessionid. to find your row in v$session you would:

select * from v$session where audsid = usernenv('sessionid');

You must grant select on v_$session to the <OWNER> of a stored procedure before the last query will work in PL/SQL stored procedures.  

Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government
Herndon VA

--
http://govt.us.oracle.com/ -- downloadable utilities  



Opinions are mine and do not necessarily reflect those of Oracle Corporation  

Anti-Anti Spam Msg: if you want an answer emailed to you, you have to make it easy to get email to you. Any bounced email will be treated the same way i treat SPAM-- I delete it. Received on Tue Sep 08 1998 - 05:30:40 CDT

Original text of this message

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