关于JOB的问题??
需实现这样一个功能,
JOB1实现每天0时0分调用PROC_1
JOB2实现每月0时0分调用PROC_2
???????
------解决方案--------------------begin
sys.dbms_job.submit(job => :job,
what => 'PROC_1;',
next_date => to_date('12-07-2008', 'dd-mm-yyyy'),
interval => 'trunc(sysdate)+1');
commit;
end;
begin
sys.dbms_job.submit(job => :job,
what => 'PROC_2;',
next_date => to_date('12-07-2008', 'dd-mm-yyyy'),
interval => 'trunc(sysdate)+1');
commit;
end;
------解决方案--------------------没什么特殊的地方吧
------解决方案--------------------第二个的interval改为'TRUNC(LAST_DAY(SYSDATE ) + 1)'
------解决方案--------------------begin
sys.dbms_job.submit(job => :job,
what => 'PROC_1;',
next_date => sysdate,
interval => 'trunc(sysdate)+1');
commit;
end;
begin
sys.dbms_job.submit(job => :job,
what => 'PROC_2;',
next_date => sysdate,
interval => 'trunc(last_day(sysdate))+1');
commit;
end;