Home » SQL & PL/SQL » SQL & PL/SQL » return array through a procedure
return array through a procedure [message #195133] Wed, 27 September 2006 02:42 Go to next message
guru_karnam
Messages: 142
Registered: May 2005
Senior Member
Hi,

I want to return an array frm pl/sql proc.



TYPE TEXTARRAY IS VARRAY(1000) OF VARCHAR2(2000);

procedure getIpv4addresslist (i_ipv4addresslist out textarray )

is
v_Ipv4addresslist textarray:=textarray();

cursor c1 is select ipaddressstart from
(select ipv4addressstart as ipaddressstart from service where isdeleted=0 and trim(lower(servicecode))!='esg' union all
select esgsessionsipv4address as ipaddressstart from networkarea where isdeleted=0);

begin
for c2 in c1 loop
v_Ipv4addresslist.extend;
v_Ipv4addresslist(v_Ipv4addresslist.count):=c2.ipaddressstart;
end loop;
i_ipv4addresslist:=v_Ipv4addresslist;
exception
when others then
errMsg := substr(sqlerrm,1,200);
raise_application_error(sqlcode, 'Get Ipv4addresses: ' || errMsg);
end;


is this the right way to return an array through procedure?
It is compiling but when i execute it is saying

wrong number or types of arguments in call to 'GETIPV4ADDRESSLIST'






Re: return array through a procedure [message #195137 is a reply to message #195133] Wed, 27 September 2006 02:50 Go to previous message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
The procedure looks fine.
I'd guess that the error is to do with the Type of the variable that you are using to hold the Out parameter when you call the procedure.
Previous Topic: writing on text file using UTL
Next Topic: Select Statement
Goto Forum:
  


Current Time: Sat Dec 03 01:19:26 CST 2016

Total time taken to generate the page: 0.07942 seconds