Home  >  Article  >  Database  >  Oracle:JOB执行带输出参数的过程

Oracle:JOB执行带输出参数的过程

WBOY
WBOYOriginal
2016-06-07 17:11:241271browse

查看所有JOB:select * from dba_jobs; 添加带参数的JOB,方法一: begin sys.dbms_job.submit(job =gt; :job1,

查看所有JOB:select * from dba_jobs;

添加带参数的JOB,方法一:

begin

  sys.dbms_job.submit(job => :job1,

                      what => 'declare n1 number(6); s2 varchar2(2000); begin pkg_xnb.prc_all(n1,s2); end;',

                      next_date => to_date('2012-02-16 20:00:00','yyyy-mm-dd hh24:mi:ss'),

                      interval => 'TRUNC(LAST_DAY(SYSDATE))+1+1/24');

  commit;

end;

方法二(适用于PLSQL,command命令添加):

variable job1 number;

begin

sys.dbms_job.submit(:job1,'declare n1 number(6); s2 varchar2(2000); begin pkg_xnb.prc_all(n1,s2); end;',to_date('2012-02-16 20:00:00','yyyy-mm-dd hh24:mi:ss'),'TRUNC(LAST_DAY(SYSDATE))+1+1/24');

end;

把命令粘贴到COMMAND时,如果不执行,输入“/”回车即可。

linux

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn