Home » SQL & PL/SQL » SQL & PL/SQL » how to initialize a pl/sql array (merged by CM)
how to initialize a pl/sql array (merged by CM) [message #446122] Fri, 05 March 2010 09:06 Go to next message
astik.mondal
Messages: 14
Registered: March 2008
Location: Kolkata
Junior Member
Hi All,

I have written a pl/sql function. But it is returing null value.
Because I have initialize pl/sql table.
can Anybody let me know how to initialize it?

--------------
return v_list
As
type value_list is table of varchar2(100);

v_list value_list:= value_list()

begin
FOR i IN types.FIRST .. types.LAST
LOOP

v_ist(i).id := v_type_id;
v_list(i).valueid := v_valueid;
v_list(i).valuename := v_value;

END LOOP;

return v_list;
end


Thanks,
Astik
Re: How to initialize a pl/sql table. [message #446125 is a reply to message #446122] Fri, 05 March 2010 09:09 Go to previous messageGo to next message
BlackSwan
Messages: 25046
Registered: January 2009
Location: SoCal
Senior Member
It would be helpful if you followed Posting Guidelines - http://www.orafaq.com/forum/t/88153/0/
Re: How to initialize a pl/sql table. [message #446133 is a reply to message #446122] Fri, 05 March 2010 09:29 Go to previous message
flyboy
Messages: 1832
Registered: November 2006
Senior Member
astik.mondal wrote on Fri, 05 March 2010 16:06
can Anybody let me know how to initialize it?

What about consulting PL/SQL User's Guide and Reference, available with other Oracle documentation e.g. online on http://tahiti.oracle.com/?

Most probably it returns empty list (not NULL). Maybe you are lucky and TYPES is empty list, otherwise it would fail with "ORA-06533: Subscript beyond count" (as you only initialized it as empty collection and did not extend for updated elements). Anyway, as TYPES along with P_IST are never declared, it is hard to tell what you are really running and how you treat the result.
Previous Topic: Heirarichal Query to get metadata information.
Next Topic: Query to get port no
Goto Forum:
  


Current Time: Fri Dec 09 08:10:42 CST 2016

Total time taken to generate the page: 0.08511 seconds