Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: How do I work out who I am inside stored proc

Re: How do I work out who I am inside stored proc

From: Daniel Morgan <dmorgan_at_exesolutions.com>
Date: Tue, 08 Oct 2002 19:52:02 GMT
Message-ID: <3DA33742.9C2A2E64@exesolutions.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US