注册

JDBC如何调用包含table类型参数的函数或过程

ZCH 2024/04/28 489 1

为提高效率,提问时请提供以下信息,问题描述清晰可优先响应。
【DM版本】: 03134284172-20240410-224357-20093 Pack1
【操作系统】:redhat 7
【CPU】: x86_64
【问题描述】*:有如下包中的函数:PKG_RECORD.GETRECORDS,入参为table类型,使用JDBC驱动如何调用传参呢?
create OR REPLACE package pkg_record is
type type_param is record(
apply_no varchar2(50),
apply_sub_no varchar2(50),
patient_id varchar2(50)
);
type type_index_param is table of type_param index by binary_integer;

function getRecords(p_tb type_index_param) return varchar2;

end;
/
create or replace package body pkg_record is
function getRecords(p_tb type_index_param) return varchar2 is
buff varchar(1000);
begin
if p_tb is not null and p_tb.count>0 then
for i in 1 .. p_tb.count loop
buff := buff||'|'||p_tb(i).apply_no||','||p_tb(i).apply_sub_no||','||p_tb(i).patient_id;
end loop;
end if;
return buff;
end;

end;
/

回答 0
暂无回答
扫一扫
联系客服