定义:
type t_numberstab is table of number;
举例:
create or replace function getbldroomidforcert(p_certid number,p_sequence number) return varchar2
is
type t_numberstab is table of number;
v_bldroomids t_numberstab:=t_numberstab();
v_cnt number:=1;
begin
for brrs in (select bldroomid,(select buildno from building where buildid=bldroom.buildid) buildno,getbrfloors(bldroomid) flooron,getbldroompart(bldroomid) part from bldroom where bldroomid in (select bldroomid from rightcertroom where certid=p_certid and exists (select 1 from rightcert where certid=p_certid and activeid=createactiveid)) order by buildno,flooron,part)
loop
v_bldroomids.extend;
v_bldroomids(v_cnt):=brrs.bldroomid;
v_cnt:=v_cnt+1;
end loop;
if v_bldroomids.exists(p_sequence) then
return v_bldroomids(p_sequence);
else
return -1;
end if;
end getbldroomidforcert;
/
show err;