用于读取记录的存储过程包头
create or replace package testEptTbl as
type charArrayType is table of varchar2(2048)
index by binary_integer;
type lcharArrayType is table of varchar2(2048)
index by binary_integer;
type numArrayType is table of int
index by binary_integer;
num INTEGER;
m_RncID INTEGER;
procedure get_R0BrdLib(
batch_size in integer,
found in out integer,
done_fetch out integer,
BoardType1 out numArrayType,/*单板类型Board Type*/
BoardName1 out charArrayType/*各子单元类型包含的子单元个数Sunit Number Per Type*/);
end testEptTbl;
/
show err
用于记录的存储过程包体
create or replace package body testEptTbl as
/* 3 */
cursor CUR_R0BrdLib is
SELECT BYBOARDTYPE,ABYBOARDNAME FROM tb_boardt;
procedure get_R0BrdLib(
batch_size in integer,
found in out integer,
done_fetch out integer,
BoardType1 out numArrayType,/*单板类型Board Type*/
BoardName1 out charArrayType/*各子单元类型包含的子单元个数Sunit Number Per Type*/) is
begin
if not CUR_R0BrdLib%isopen then
open CUR_R0BrdLib;
end if;
done_fetch := 0;
found := 0;
for i in 1..batch_size loop
fetch CUR_R0BrdLib
into BoardType1(i),BoardName1(i);
if CUR_R0BrdLib%notfound then
close CUR_R0BrdLib;
done_fetch := 1;
exit;
else
found := found + 1;
end if;
end loop;
end get_R0BrdLib;
end testEptTbl;
/
show err
1.3.2 游标方式: