RE: own session's SID

Before someone points out I didn't need the extra select:

UT1 > select sid from v$session
  2  where audsid = sys_context('userenv','sessionid')
  3  /

       SID
----------
        46

Is it the weekend yet?



-----Original Message-----
From: oracle-l-bounce@xxxxxxxxxxxxx
[mailto:oracle-l-bounce@xxxxxxxxxxxxx]On Behalf Of Powell, Mark D
Sent: Friday, October 15, 2004 3:10 PM
To: oracle-l@xxxxxxxxxxxxx
Subject: RE: own session's SID


You can still use the old version 7 method:

UT1 > select sid from v$mystat  where rownum = 1;

       SID
----------
        46

UT1 > SELECT sid FROM v$session WHERE  audsid = userenv('sessionid');

       SID
----------
        46

Though I guess a more modern way to write this would be as
  1  select sid from v$session
  2* where audsid = (select sys_context('userenv','sessionid') from dual)
UT1 > /

       SID
----------
        46

HTH -- Mark D Powell --


-----Original Message-----
From: oracle-l-bounce@xxxxxxxxxxxxx
[mailto:oracle-l-bounce@xxxxxxxxxxxxx]On Behalf Of sol beach
Sent: Friday, October 15, 2004 2:48 PM
To: oracle-l@xxxxxxxxxxxxx
Subject: own session's SID


Other than 

SELECT sid from v$mystat where rownum = 1;

what are other ways in V9.2 to get your own session SID programatically?
--
http://www.freelists.org/webpage/oracle-l
--
http://www.freelists.org/webpage/oracle-l
--
http://www.freelists.org/webpage/oracle-l

Other related posts: