-2

I created job in Oracle. I set interval properly. But the job started automatically after I created it .

DECLARE
    X NUMBER; 
BEGIN 
    SYS.DBMS_JOB.SUBMIT ( 
         job => X 
          ,what => 'MISSING_REVENUE_EXPENSE_ICR;' 
          ,next_date => to_date('29/04/2015 04:00:00','dd/mm/yyyy hh24:mi:ss')
          ,interval => '(trunc(sysdate)+1)+4/24' 
          ,no_parse => FALSE ); 
    SYS.DBMS_OUTPUT.PUT_LINE('Job Number is: ' || to_char(x));
    COMMIT; 
END;

Why this happened? Tell me some fix for this issue.

APC
  • 144,005
  • 19
  • 170
  • 281
  • 3
    Please provide your statement for job creation. – Janis Baiza Apr 29 '15 at 05:47
  • You must provide a "next date" for running the job - what date did you provide? – WW. Apr 29 '15 at 05:59
  • Please look at this code below: X NUMBER; BEGIN SYS.DBMS_JOB.SUBMIT ( job => X ,what => 'MISSING_REVENUE_EXPENSE_ICR;' ,next_date => to_date('29/04/2015 04:00:00','dd/mm/yyyy hh24:mi:ss') ,interval => '(trunc(sysdate)+1)+4/24' ,no_parse => FALSE ); SYS.DBMS_OUTPUT.PUT_LINE('Job Number is: ' || to_char(x)); COMMIT; END; – Parag Dhatavkar Apr 29 '15 at 06:39
  • so for next_date i need to provide tomm. data .I provide todays date.I think this is issue right. – Parag Dhatavkar Apr 29 '15 at 06:43

1 Answers1

0

The problem is this line:

next_date => to_date('29/04/2015 04:00:00','dd/mm/yyyy hh24:mi:ss')

That parameter has a misleading name, because it is the date for the initial run. The documentation shows what happens but doesn't entirely resolve the ambiguity.

Anyway, you have given today's date so it started today.

APC
  • 144,005
  • 19
  • 170
  • 281