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

Home -> Community -> Usenet -> c.d.o.misc -> Re: getting job number of queued job

Re: getting job number of queued job

From: Andrew Barnett <nobody_at_spamandeggs.bp.com>
Date: 1998/03/11
Message-ID: <01bd4cac$03dc5860$8c0564a1@azmelw1358.mel.az.bp.com>#1/1

could use userenv('sessionid') to get a session id, join that to audsid in v$session to get sid, join that to sid in dba_jobs_running.

select j.job
from dba_jobs_running j, v$session s
where j.sid = s.sid
and s.audsid = userenv('sessionid')

-- 
Andrew - Wizzard

barnetaj_at_bp.com

ParrisG <parrisg_at_aol.com> wrote in article
<19980311040000.XAA19037_at_ladder02.news.aol.com>...

> Is there a way for a procedure running in the job queue to obtain it's
job
> number from the ORACLE environment, instead of having to pass it in as a
> parameter.
>
> Using the dbms_job package, the job parameter must be part of the
parameter
> list on the submit, e.g.
>
> dbms_job.submit(job_number, p1(job),...);
>
> Instead of passing the job parameter, can p1 figure out it's job number
from
> some environmental call - NOTE - I could check in the user_jobs table but
if
> there are more than one instances of P1, I'm stuck.
>
> Could you e-mail me at ParrisG_at_aol.com
>
> Thanks
> Parris
>
Received on Wed Mar 11 1998 - 00:00:00 CST

Original text of this message

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