0

下面是我创建的 dbms_scheduler,根据我创建的工作,它必须在我提到的时间从 empp 表中删除员工“simon”,程序成功执行但行没有被删除,请帮我解决。

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;

提前致谢

4

1 回答 1

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;
于 2012-12-26T15:15:38.237 回答