Question
Oracle Scheduler Job Fails to Run: Not an Appropriate Date Error
I am trying to create a scheduler job in Oracle. The job gets created and appears in the list of jobs, but it fails to run at the scheduled time, instead giving an error. For example, right now it gives the error '04-JUL-24' is not an appropriate date. How can I fix this issue?
CREATE OR REPLACE PROCEDURE RPPR_DAILY_REP_CALL AS
BEGIN
DBMS_SCHEDULER.CREATE_JOB(JOB_NAME => 'DAILY_BATCH',
JOB_TYPE => 'PLSQL_BLOCK',
JOB_ACTION => 'BEGIN RPPR_DAILY_REP_BATCH;END;',
START_DATE => SYSTIMESTAMP,
REPEAT_INTERVAL => 'FREQ=DAILY; BYHOUR=8; BYMINUTE=0; BYSECOND=0',
ENABLED => TRUE,
AUTO_DROP => FALSE,
COMMENTS => 'JOB TO RUN PROCEDURE AT 8AM');
DBMS_SCHEDULER.RUN_JOB(JOB_NAME => 'DAILY_BATCH');
END;
ERROR FACED:
ORA-23319: parameter value "04-JUL-24" is not appropriate
ORA-06512: at "SYS.DBMS_JOB", line 84
ORA-06512: at "SYS.DBMS_JOB", line 163
ORA-06512: at "REGREP.RPPR_DAILY_REP_BATCH", line 8
ORA-06512: at line 1
ORA-06512: at "SYS.DBMS_ISCHED", line 209
ORA-06512: at "SYS.DBMS_SCHEDULER", line 594
ORA-06512: at "REGREP.RPPR_DAILY_REP_CALL", line 12
ORA-06512: at line 3
WHILE I RUN
BEGIN
DBMS_SCHEDULER.DROP_JOB('DAILY_BATCH');--ONLY WHEN JOB ALREADY EXISTS
RPPR_DAILY_REP_CALL;
END;