Loading

Oracle job调用存储过程

在PL/SQL中的what值中直接写入存储过程的名称+“分号”;

begin
  sys.dbms_job.submit(job => :job,
                      what => 'del_ky_items;',
                      next_date => to_date('24-06-2015 16:30:00', 'dd-mm-yyyy hh24:mi:ss'),
                      interval => 'trunc(sysdate,''mi'')+1/24');
  commit;
end;
/

如果有参数,使用两个单引号把字符串引起来;

都是不需要call语句的;

begin
  sys.dbms_job.submit(job => :job,
                      what => 'del_ky_items(1,''a'',sysdate);',
                      next_date => to_date('24-06-2015 16:30:00', 'dd-mm-yyyy hh24:mi:ss'),
                      interval => 'trunc(sysdate,''mi'')+1/24');
  commit;
end;
/

 

posted @ 2015-06-24 15:44  stono  阅读(995)  评论(0编辑  收藏  举报