查看所有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时,如果不执行,输入“/”回车即可。
,