Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: own session's SID

RE: own session's SID

From: Powell, Mark D <mark.powell_at_eds.com>
Date: Fri, 15 Oct 2004 15:18:48 -0400
Message-ID: <564DE4477544D411AD2C00508BDF0B6A2133DF4D@usahm018.exmi01.exch.eds.com>


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_at_freelists.org
[mailto:oracle-l-bounce_at_freelists.org]On Behalf Of Powell, Mark D Sent: Friday, October 15, 2004 3:10 PM
To: oracle-l_at_freelists.org
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_at_freelists.org
[mailto:oracle-l-bounce_at_freelists.org]On Behalf Of sol beach Sent: Friday, October 15, 2004 2:48 PM
To: oracle-l_at_freelists.org
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 Received on Fri Oct 15 2004 - 14:14:31 CDT

Original text of this message

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