oracle存储进程记载ITeye - 众发娱乐

oracle存储进程记载ITeye

2019年02月28日13时49分51秒 | 作者: 华晖 | 标签: 参数,调用,游标 | 浏览: 2754

l_process_instance_id varchar2(30); cursor mycur is select t1.domino_path,t1.process_instance_id from engine.t_engine_process_instance t1 left join ts_org t2 on(t1.drafter_dept_id=t2.org_id) where t1.status=2002 and t2.whole_org_id like /1010/10157/% and t1.drafter_id=30265 and t1.draft_time TO_DATE(20120101,yyyymmdd);; begin open mycur; loop fetch mycur into l_domino_path,l_process_instance_id; 将游标中的数据导入自己界说的参数中 exit when mycur %notfound; update engine.t_engine_process_instance t set t.status=2008 where t.domino_path=l_domino_path; update engine.t_engine_process_workitem t set t.status=2001 where t.domino_path=l_domino_path; update engine.t_unified_workitem t set t.status=2001 where t.domino_path=l_domino_path; update engine.t_engine_activity_instance t set t.status=2001 where t.process_instanceid=l_process_instance_id; end loop; close mycur; end closemt;
调用
call closemt();


此内容能够优化成带参数的
create or replace procedure close4(begin_date in varchar2) is
 l_domino_path varchar2(50);
 l_process_instance_id varchar2(50);
 cursor mycur is select t1.domino_path,t1.process_instance_id from engine.t_engine_process_instance t1 left join ts_org t2 on(t1.drafter_dept_id=t2.org_id) where t1.status=2002 and t2.whole_org_id like /1010/10157/% and t1.draft_time TO_DATE(begin_date,yyyymmdd);
 begin 
 open mycur; 
 loop
 fetch mycur into l_domino_path,l_process_instance_id;
 exit when mycur %notfound;
 update engine.t_engine_process_instance t set t.status=2008 where t.domino_path=l_domino_path;
 update engine.t_engine_process_workitem t set t.status=2001 where t.domino_path=l_domino_path;
 update engine.t_unified_workitem t set t.status=2001 where t.domino_path=l_domino_path;
 update engine.t_engine_activity_instance t set t.status=2001 where t.process_instanceid=l_process_instance_id;
 end loop;
 close mycur;
end close4;

调用
call close4(20110701);


其它链接:http://www.cnblogs.com/happyday56/archive/2007/07/05/806830.html
版权声明
本文来源于网络,版权归原作者所有,其内容与观点不代表众发娱乐立场。转载文章仅为传播更有价值的信息,如采编人员采编有误或者版权原因,请与我们联系,我们核实后立即修改或删除。

猜您喜欢的文章

阅读排行

  • 1
  • 2

    oracle存储进程记载ITeye

    参数,调用,游标
  • 3

    oracle学习笔记1ITeye

    运用,数据库,特性
  • 4

    oracle学习笔记1ITeye

    运用,数据库,特性
  • 5
  • 6
  • 7
  • 8
  • 9

    oracle数据同步技能ITeye

    数据,技能,数据库
  • 10