Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: job is not on time
> #oracle 9i enterprise on red-hat
>
> Hi all
> I can't get an oracle job to repeat at the desired time every day
>
> it should start at 6am every day
> it works the very first time, but the day after just start at midnight
>
> the job is created with the following script:
>
> variable jobno number;
> variable instno number;
> BEGIN
> dbms_job.submit(
> :jobno,
> 'scott.engine_pck.my_proc;',
> trunc(sysdate+1)+6/24,
> 'trunc(sysdate+1)',
> TRUE);
>
> COMMIT;
> END;
For next date you use trunc(sysdate+1).
When your job runs for the first time, it evaluates trunc(sysdate+1), and it
is next midnight.
You should use 'sysdate+1' instead.
Received on Thu Mar 11 2004 - 11:22:51 CST