weixin_41931064
weixin_41931064
2018-10-20 11:38
采纳率: 16.7%
浏览 1.4k

怎么在oracle中创建带参数的job

存储过程如下:
create or replace procedure Get_WELL_INJ_FCHGL(yearmonth in out varchar2,
result out sys_refcursor) is
begin
--删除临时表注入井数据
delete from temp_inj;
dbms_output.put_line(yearmonth);
if yearmonth = 'rq' then
select to_char( sysdate,'yyyymm') into yearmonth from dual;
end if;

/

begin
sys.dbms_job.submit(job => :job,
what => 'declare s1 sys_refcursor;rq varchar2(10);
begin
select to_char(sysdate,''yyyymm'') into rq from dual;
GET_WELL_INJ_FCHGL(rq,s1); end;',
next_date => to_date('03-11-2018', 'dd-mm-yyyy'),
interval => 'TRUNC(SYSDATE+1)+12/24');
sys.dbms_job.broken(job => :job,
broken => true,
next_date => to_date('03-11-2018', 'dd-mm-yyyy'));
commit;
end;
/
这个job代码完全没看懂,能帮我一点一点讲一下么?

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

相关推荐