Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Find out session ID
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
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