Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: DBMS-JOBS - ids
On Tue, 27 Jan 1998 21:25:51 +0000, Jonathan Waland <jonathan.waland_at_vf.vodafone.co.uk> wrote:
>Is it possible for a dbms_job to find out it's own job id?
>
>I want to be able to submit n-jobs, and when a job runs it
>would be aware of it's job id (for logging purposes for example)
>
You can get it but the owner of the job has to have direct select privileges on v$session and dba_jobs_running.
You get the session ID from v$session, the auditing session id
from the userenv function, and the job ID for that session from
DBA_JOBS_RUNNING:
select job
from dba_jobs_running
where sid = (select sid from v$session
where audsid=userenv('SESSIONID'));
Hope this helps.
-- -bn random_at_interaccess.com (PGP 2.6.2 public key available on request) "There is no .signature -- only ZUUL!"Received on Thu Jan 29 1998 - 00:00:00 CST
![]() |
![]() |