这个过程有address_table out pkg.address_tab_type
create or replace
procedure hr.p_get_address
(
in_pid in number,
address_table out pkg.address_tab_type
)
as
address_row pkg.address_rec_type;
cursor address_cursor is
select
addr.pid, addr.street, addr.city
from
hr.address addr
where
pid = in_pid;
begin
row_count := 0;
open address_cursor;
loop
fetch address_cursor into address_row;
exit when address_cursor%NOTFOUND;
row_count := row_count + 1;
address_table(row_count) := address_row;
end loop;
close address_cursor;
end p_get_address;
我的 pkg 声明了自定义 address_rec_type 和 address_tab_type:
create or replace
package hr.pkg as
type address_rec_type is
record
(
pid address.pid%type,
street address.street%type,
city address.city%type
);
type address_tab_type is
table of address_rec_type index by binary_integer;
end hr.pkg;
当我在 SQL Developer 中执行我的存储过程时,一切工作文件。所以,我的过程。作品。我需要调用此过程并在 C# (ASP.NET) 中获取 address_table。我正在使用 odp.net。我可以用 refCursor 调用程序,工作正常。如何使用用户定义类型的输出参数调用过程?