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

存储过程如下:
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代码完全没看懂,能帮我一点一点讲一下么?

0

1个回答

0
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!