Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: About DBMS_JOB Package question.
lee wrote:
> Interval:=15;
> DBMS_JOB.SUBMIT(JobNo,
> 'MyProcedure(arg,...)',
> StartTime,
> 'DECODE(ceil(EndTime-SysDate),0,NULL,SysDate+Interval/1440)',false);
The 'DECODE...' parameter is a varchar2 string that is executed by the
job to schedule the subsequent execution. Therefore it is running in
another session and can't see your "Interval" variable.
In fact, your "Interval" variable probably has gone out of scope by then
anyway.
Try something like:
Interval:=15;
DBMS_JOB.SUBMIT(JobNo,
'MyProcedure(arg,...)',
StartTime,
'DECODE(ceil(TO_DATE(''' || EndTime || ''')-SysDate),0,NULL,SysDate+'
|| Interval || '/1440)',false);
Received on Tue May 19 1998 - 20:56:16 CDT