oracle中定时任务DBMS_JOB.SUBMIT的用法?

2024-12-02 03:03:51
推荐回答(2个)
回答1:

begin
sys.dbms_job.submit(job => :job,
what => 'myProc;myProcs;myProcss(''测试'');',//用分号将多个存储过程分开,有参数的话直接写就可以了
next_date => to_date('07-04-2011 22:00:00', 'dd-mm-yyyy hh24:mi:ss'),
interval => 'sysdate+1');
commit;
end;

回答2:

先合成一个,
CREATE OR REPLACE PROCEDURE daily_process IS

BEGIN
delete_temp;
generate;
generate1('参数');
END;

begin
sys.dbms_job.submit(job => :job,
what => 'PROCESS_name(参数1,参数2...);',
next_date => to_date('08-04-2011 22:00:01', 'dd-mm-yyyy hh:mi'),
interval => 'TRUNC(SYSDATE+1)');
commit;
end;
/