Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: How do I work out who I am inside stored proc
David Owen wrote:
> I apologise if this is a 'newbie' question that is answered millions of
> times, but I have searched the manuals, Google and as many FAQs as I can
> find and the answer does not leap out at me.
>
> I am writing a stored procedure that will be running a fairly long job. I
> have a separate monitoring process that checks to see progress. I would
> like to store the SPID of the executing process, or some system identifier,
> to check to see if the thing has failed. Grep'ing through the view
> v$process does not help, since there might actually be several jobs running
> at the same time. I am looking for a nice little function 'get_spid()' or
> similar.
>
> Thanks in advance
>
> dowen
> --
> David Owen Midsomer Consultants Inc. dowen_at_midsomer.org
SELECT user
INTO x
FROM dual;
Or use the SYS_CONTEXT function if your version (unnamed of course) supports it.
In the future provide, at a minimum Oracle version and edition.
Daniel Morgan Received on Tue Oct 08 2002 - 14:52:02 CDT