Cause of that error is, I believe, the fact that you didn't enclose DBMS_SCHEDULER.CREATE_JOB
into a BEGIN-END
block:
begin
dbms_scheduler.create_job(...);
end;
/
Also, repeat_interval
looks wrong (at least, in my 11g). There's no BYTIME
- use BYHOUR
and BYMINUTE
combination instead. Something like this (note that I don't have your procedure):
SQL> BEGIN
2 DBMS_SCHEDULER.CREATE_JOB (
3 job_name => 'test',
4 job_type => 'STORED_PROCEDURE',
5 job_action => 'p_test',
6 number_of_arguments => 0,
7 start_date => TO_TIMESTAMP_TZ('2021-01-12 14:31:21.000000000 AMERICA/NEW_YORK','YYYY-MM-DD HH24:MI:SS.FF TZR'),
8 repeat_interval => 'FREQ=DAILY;BYDAY=MON,TUE,WED,THU,FRI;BYHOUR=14;BYMINUTE=45',
9 end_date => NULL,
10 enabled => FALSE,
11 auto_drop => FALSE,
12 comments => 'This job will populate date in new table.');
13 END;
14 /
PL/SQL procedure successfully completed.
SQL>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…