3,491
社区成员
发帖
与我相关
我的任务
分享
create or replace procedure autoUpdate(status number,dateTime date) as
begin
for cur_row in select status,datatime from a loop
if(cur_row.datetime = sysdate and cur_row.status = x) then
update ........set ......;
end if;
commit;
end loop;
end
----创建job
Begin
sys.dbms_job.submit(job => 301,
what => 'autoUpdate;',
next_date => to_date('2010-06-01', 'YYYY-MM-DD'),
interval => 'TRUNC(LAST_DAY(SYSDATE)+1)');
Commit;
End;