oracle存储过程,自定义类型,plsql客户端test

杀马特。学长 韩版系。学妹 提交于 2021-01-22 22:21:55

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;

test结果

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!