1、oracle存储过程
create or replace procedure pf_demo_proc(in_type_receive_commissions_array in type_receive_commissions_array,
returnvalue out varchar2 --返回结果 1 成功 0 失败
) as
p_name varchar2(1000);
p_sqlerrm varchar2(1000);
p_error varchar2(1000);
v_guid varchar2(32) := md5(sys_guid());
begin
FOR i IN 1 .. in_type_receive_commissions_array.count LOOP
returnvalue:=returnvalue||'{id:'||in_type_receive_commissions_array(i).contract_no||', name:'||in_type_receive_commissions_array(i).receive_amount||'},';
END LOOP;
end pf_demo_proc;
2、plsql客户端存储过程test测试
declare
-- Non-scalar parameters require additional processing
--in_type_receive_commissions_arr type_receive_commissions_array;
v_type1 type_receive_commissions := type_receive_commissions('01','02','03','04','05','06');
v_type2 type_receive_commissions := type_receive_commissions('11','12','13','14','15','16');
v_type3 type_receive_commissions := type_receive_commissions('21','22','23','24','25','26');
in_type_receive_commissions_array type_receive_commissions_array := type_receive_commissions_array(v_type1, v_type2, v_type3);
begin
-- Call the procedure
pf_demo_proc(in_type_receive_commissions_array => in_type_receive_commissions_array,
returnvalue => :returnvalue);
end;
来源:oschina
链接:https://my.oschina.net/u/199596/blog/4920959