Re: Current Session Identifier

From: James Peterson <james.peterson_at_teldta.com>
Date: 1996/06/07
Message-ID: <4p9d11$1oa_at_news2.tds.net>#1/1


Hi,

I think this is not quite correct. userenv('SESSIONID') does return a session id for auditing purposes but this is not the same sid as is stored in v$session. However a variation may be closer.

select sid
from v$session
where terminal = userenv('TERMINAL');

This returns an accurate sid in my environment. The SQL Language Reference says it will behave differently for a distributed SQL statement. I have not tried that.

You have to also consider how unique an identifier TERMINAL is. I assume that if your process is running in the background this will not return useful results.

Jim Peterson

-- 

=============================

Jim Peterson
TDS Computing Services
Madison, WI USA
james.peterson_at_teldta.com
Received on Fri Jun 07 1996 - 00:00:00 CEST

Original text of this message