Re: Need a way to know SessionID
Posted in 1997
In article <5o27gd$4eb@cssun.mathcs.emory.edu>, TASHKOP@kiwi.co.nz says...
>
>Hello people
>I am looking for a way to know current database
>from a generic stored procedure used to kickstart
>4gl programs.
>If SID were known I could get this info from
>sysmaster:sysopendb, or use onstat, but I do not
>know how to get the SID either.
>Presumably we could shell out and get PPID, then
>get sid but the latency for this would not be
>acceptable.
>
>My question is;
>Is there a way to get current database name or
>sessionid from a stored procedure?
>(714.UD1 - Solaris 2.4)
>
>I will summarize to the list.
>
>TIA
>Peter Tashkoff <tashkop@zespri.co.nz>
>Zespri International Limited
>This posting may not be used by any party to vilify
>another. Standard disclaimers apply.
>
>
>
Hi,
DBINFO('sessionid') will do, I reckon:
create procedure sid () returning intreturn dbinfo('sessionid');
end procedure
or expand the procedure as you wish .
Cheers,
Ilya