|
Oracle数据库创建定时任务执行语句//注释:时间为每日的凌晨1点,执行一遍即可,预防创建多个,请不要连续点击执行;
- declare
- jobno number;
- begin
- dbms_job.submit(
- job => jobno,
- what => 'delete from pdss.rule_interaction_effect
- where (drug_code1,drug_name1,drug_code2,drug_name2) in
- (select drug_code1,drug_name1,drug_code2,drug_name2
- from pdss.rule_interaction_effect
- group by drug_code1,drug_name1,drug_code2,drug_name2
- having count(*) > 1)
- and id not in (select min(id)
- from pdss.rule_interaction_effect
- group by drug_code1,drug_name1,drug_code2,drug_name2
- having count(*) > 1);',
- next_date => sysdate,
- interval => 'trunc(sysdate+1)+(1*60)/(24*60)');
- commit;
- end;
复制代码
|
|