调度作业未在dbms_scheduler中发生

时间:2012-12-24 09:12:40

标签: oracle plsql oracle10g oracle11g

下面是我创建的dbms_scheduler,根据我创建的工作,它必须删除员工" simon"从我提到的empp表开始,程序成功执行但行没有删除,请帮我解决。

begin
 dbms_scheduler.create_job
 (job_name => 'test_full_job_def',
 job_type => 'PLSQL_BLOCK',
 job_action=> 
   'begin 
    delete from empp where NAME="simon"; 
    commit; 
   end;',
   repeat_interval => 'FREQ=DAILY; BYHOUR=13; BYMINUTE=30',
   enabled=>true,
   auto_drop=>false,
   comments=>'Delete simon matches from the empp table');
end;

提前致谢

1 个答案:

答案 0 :(得分:0)

请尝试使用此代码

begin
 dbms_scheduler.create_job
 (job_name => 'test_full_job_def',
 job_type => 'PLSQL_BLOCK',
 job_action=> execute immediate('delete from empp where NAME='simon''),
   repeat_interval => 'FREQ=DAILY; BYHOUR=13; BYMINUTE=30',
   enabled=>true,
   auto_drop=>false,
   comments=>'Delete simon matches from the empp table');
end;