I wanted to create a job that will run tomorrow at noon and recur every day at noon, so I executed this script:
DECLARE X NUMBER; BEGIN SYS.DBMS_JOB.SUBMIT ( job => X ,what => 'BEGIN MyProcedure(); END;' ,next_date => to_date('24/04/2012 12:00:00','dd/mm/yyyy hh24:mi:ss') ,interval => 'TRUNC(SYSDATE+1)+12/24' ,no_parse => FALSE ); SYS.DBMS_OUTPUT.PUT_LINE('Job Number is: ' || to_char(x)); SYS.DBMS_JOB.BROKEN (job => X, broken => FALSE); COMMIT; END; / Job Number is: 131
When I looked at the status of job 131 it was executing already! THIS_DATE was
Why did this job execute immediately?
Was it because of the
SYS.DBMS_JOB.BROKEN call? I used TOAD to generate this script, and I changed the default
broken => TRUE value that TOAD generated to be