存储过程大神有木有?
create or replace procedure sp_check_to_market(
wf_id_in in number,
form_data_id_in in number,
market_id in varchar2
--return_code out number,
-- return_desc out varchar2
)
is
type c_array is table of varchar2(10) index by binary_integer;
p number default 0;
idx number default 0;
strc varchar2(500);
ca c_array;
market_id2 varchar(500);
begin
strc:=market_id;
loop
p:=instr(strc,'-',1);
exit when p=0;
ca(idx):=substr(strc,1,p-1)||',';
dbms_output.put_line(ca(idx));
idx:=idx+1;
p:=instr(strc,'|',1);
exit when p=0;
strc:=substr(strc,p+1,length(strc));
select status_id into market_id2 from ecl_request_sheet where request_id in(ca(idx));
--if market_id2<>6 then
-- dbms_output.put_line('可以');
-- else dbms_output.put_line('不可以');
-- end if;
end loop;
COMMIT;
EXCEPTION
WHEN OTHERS THEN
ROLLBACK;
RAISE;
END;
begin
sp_check_to_market(101525,60041,'101518-销售合同评审流程 [ HTP-20130114-001 ] |101470-销售合同评审流程 [ HTP-20130109-001 ]');
end;
执行的时候未找到任何数据!
wf_id_in in number,
form_data_id_in in number,
market_id in varchar2
--return_code out number,
-- return_desc out varchar2
)
is
type c_array is table of varchar2(10) index by binary_integer;
p number default 0;
idx number default 0;
strc varchar2(500);
ca c_array;
market_id2 varchar(500);
begin
strc:=market_id;
loop
p:=instr(strc,'-',1);
exit when p=0;
ca(idx):=substr(strc,1,p-1)||',';
dbms_output.put_line(ca(idx));
idx:=idx+1;
p:=instr(strc,'|',1);
exit when p=0;
strc:=substr(strc,p+1,length(strc));
select status_id into market_id2 from ecl_request_sheet where request_id in(ca(idx));
--if market_id2<>6 then
-- dbms_output.put_line('可以');
-- else dbms_output.put_line('不可以');
-- end if;
end loop;
COMMIT;
EXCEPTION
WHEN OTHERS THEN
ROLLBACK;
RAISE;
END;
begin
sp_check_to_market(101525,60041,'101518-销售合同评审流程 [ HTP-20130114-001 ] |101470-销售合同评审流程 [ HTP-20130109-001 ]');
end;
执行的时候未找到任何数据!
...全文
相关推荐
MySQL存储过程综述及如何使用Navicat创建存储过程
一、什么是MySQL存储过程? 在大型项目中,有时候需要重复执行能够完成特定功能的SQL语句集,而MySQL为我们提供了存储过程的概念,存储过程是数据库中的一个重要对象,它是存储在数据库中的一组完成特定功能的SQL语句集。它第一次编译后,只要没有修改,处处都可以直接调用且不用重新编译,用户通过指定存储过程的名字和参数(若该存储过程存在参数)来执行它。 二、存储过程的特点 1:能够完成复杂的判断和运算; 2:可编程性强,且使用灵活; 3:可重复使用SQL编程代码; 4:执行速度相对较快; 5:能够减少网络之间的传输开销 三、Navicat创建一个存储过程 (1):先选择某个数据库中的函
ORACLE存储过程最全教程
超实用最全的ORACLE教程
Java调用存储过程的2种方法
Java调用存储过程的2种方法 Java调用存储过程的2种方法 Java调用存储过程的2种方法
SQL存储过程SQL存储过程SQL存储过程
存储过程SQL存储过程SQL存储过程SQL存储过程SQL存储过程SQL存储过程SQL存储过程SQL存储过程SQL存储过程SQL存储过程SQL存储过程SQL存储过程SQL存储过程SQL存储过程
MyBatis调用存储过程
怎么使用MyBatis调用存储过程,步骤详细清楚,一看就会配置


Web 开发

