Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Getting SID in PL/SQL
Can you normally select from V$SESSION? If not, you will need to get
access to this view.
Maybe a better thing to do (since I don't know if you want a number or a string) is to use DBMS_PIPE.unique_session_name. Or maybe better yet to call tmpnam(3) from the C run time library. Or use the random number generator package from O8 (sorry, my client is too chicken to go to 8 and I don't have installed on my PC yet), or download the random number generator package from technet, etc.
rr
Thomas Keller wrote:
> Hi,
>
> I need a value that's unique at a time (but all values should be in the
> smallest possible range). My idea was to use the SID (for example from
> V$SESSION).
> Is it possible to get the Value from anywhere? When I try a SELECT from
> V$SESSION in a package I get an error when compiling the package...
>
> Any Ideas?
>
> Thomas Keller
Received on Tue May 04 1999 - 22:37:35 CDT
![]() |
![]() |