利用oracle的job定时执行任务

Posted on 2006-08-25 15:53 相信未来 阅读(833) 评论(0)  编辑  收藏

variable ds number;
begin
  dbms_job.submit(:ds,'insert into testdb values(500);',sysdate,'sysdate+1/360');
  commit;
end;

variable ds number;
begin
  dbms_job.submit(:ds,'insert into testdb values(500);',sysdate,null);
  commit;
end;

variable ds number;
begin
  dbms_job.submit(:ds,'insert into testdb values(600);',to_date('2005-12-01 10:35:30','yyyy-mm-dd hh24:mi:ss'),'sysdate+1/360');
  commit;
end;

-------------------------------------------------------
select job from user_jobs;

-------------------------------------------------------
begin
  dbms_job.remove(1);
  dbms_job.remove(2);
  commit;
end;


只有注册用户登录后才能发表评论。


网站导航:
 

posts - 5, comments - 0, trackbacks - 0, articles - 1

Copyright © 相信未来