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: not allowing a job to run if it failed..

Re: not allowing a job to run if it failed..

From: Vladimir M. Zakharychev <bob_at_dpsp-yes.com>
Date: Fri, 27 Sep 2002 14:39:50 +0400
Message-ID: <an1cks$mr9$1@babylon.agtel.net>


Actually, job code is wrapped into a block of code like this:

DECLARE
 job BINARY_INTEGER := :job;
 next_date DATE := :mydate;
 broken BOOLEAN := FALSE;
BEGIN
 <job code goes here>
 :mydate := next_date;
 IF broken THEN :b := 1; ELSE :b := 0; END IF;  END; I think it's pretty obvious from this code how you can stop your job from running, as well as how to change its next run date/time and how to get the job ID...

Spoiler follows:

 begin
  <actual job code>
 exception
  when others then

     broken := true;
 end;

-- 
Vladimir Zakharychev (bob@dpsp-yes.com)                http://www.dpsp-yes.com
Dynamic PSP(tm) - the first true RAD toolkit for Oracle-based internet applications.
All opinions are mine and do not necessarily go in line with those of my employer.


"Karen Abgarian" <abvk_at_ureach.com> wrote in message news:3D940EDB.B2A1B4E8_at_ureach.com...

> Your job is a plsql code, you can make jobs broken by calling
> a DBMS_JOB procedure somewhere in the exception handler.
> I think the procedure name is BROKEN() but it is easy to check.
> You might need another call to get the job id of your job.
> That will effectively prevent them from running.
>
> Is that what you are looking for?
>
> I cannot tell if there are any enhancements to the jobs in 9i worth
> checking
>
> Regs
> AK
>
> NetComrade wrote:
>
> > Is there are an easy way to do this (some parameter?)
> >
> > or should I work on a workaround (like a wrapper).
> >
> > when my jobs fail, i don't want them to rerun.
> >
> > Thanx.
> > .......
> > We use Oracle 8.1.7.3 on Solaris 2.7 boxes
> > remove NSPAM to email
>
Received on Fri Sep 27 2002 - 05:39:50 CDT

Original text of this message

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