Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Getting SID in PL/SQL
Try the following:
declare
v_sid number;
begin
select userenv('sessionid')
into v_sid
from dual;
end;
This will give you the unique AUDSID value from the v$session view.
Kenny Gump
OCP 7.3 DBA
Thomas Keller wrote in message <372F2606.F63A4DDA_at_debis.com>...
>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 - 13:55:37 CDT