| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> Re: sid
Patrick Tan <ptan_at_mindspring.com> wrote in article
<343D5080.46FA90C0_at_mindspring.com>...
> How can I get sid of my current connection? I know I can get sid of all
> current users from v$session. There will be several same Oracle user
> connecting to the DB at the same time, each need to return unique sid in
> their session. Thanks.
Method 1:
Use DBMS_APPLICATION_INFO.SET_CLIENT_INFO to set the CLIENT_INFO column to
a random value in v$session. Then select your sid from v$session using
CLIENT_INFO = random value from v$session.
Method 2:
The column OSUSER contains the NetBIOS name of a Windows PC. If your PC's
NetBIOS name is PatrickT for example, you can select sid from v$session
where OSUSER equals that name. To use this method in a program (Delphi or
VB for example), use the GETCOMPUTERNAME api call to get the NetBIOS name.
Method 3:
Simply use the v$mystat table instead of v$session - it contains your
session id. :-)
regards,
Billy
Received on Fri Oct 10 1997 - 00:00:00 CDT
![]() |
![]() |