How to execute the jobs in oracle? [closed]

百般思念 提交于 2020-01-06 05:25:08

问题


I have a simple job which is:

BEGIN
DBMS_SCHEDULER.CREATE_JOB (
job_name => 'offc.My_job1',
job_type => 'STORED_PROCEDURE',
job_action => 'offc.MYPROC',
start_date => sysdate,
repeat_interval => 'FREQ=SECONDLY;INTERVAL=5',
end_date => '02-Jan-2020 10:29:05 PM',
auto_drop => FALSE,
comments => 'My new job');
END;
/

Now,I tried to run the job using:

EXEC DBMS_SCHEDULER.ENABLE(‘My_job1’);

I got error as:

PLS-00103: Encountered the symbol "‘" when expecting one of the following:

   ( ) - + case mod new not null <an identifier>
   <a double-quoted delimited-identifier> <a bind variable>
   table continue avg count current exists max min prior sql
   stddev sum variance execute multiset the both leading
   trailing forall merge year month day hour minute second
   timezone_hour timezone_minute timezone_region timezone_abbr
   time timestamp interval date
   <a string literal with character set specification>

Also,I tried,

 DBMS_SCHEDULER.enable (name => 'My_job1');

I got error as:

ORA-00900: invalid SQL statement

Both of them are not working.Why is not my job being runned?


回答1:


I think you are again facing issue of the single quote.

EXEC DBMS_SCHEDULER.ENABLE(‘My_job1’);

Here quotes is not supported by oracle. It should be ' .

EXEC DBMS_SCHEDULER.ENABLE('My_job1');

Cheers!!



来源:https://stackoverflow.com/questions/59567073/how-to-execute-the-jobs-in-oracle

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!