Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

nested table -- uninitialized collection error

403863Feb 23 2007 — edited Feb 23 2007
Hello,
Here are the steps I followed,
a) create type idList is table of number;
b) CREATE OR REPLACE procedure exp_type (my_list out IdList)
is
i number := 1;
cursor c is
select val from exp_array;
begin
for rec in c
loop
i := i + 1;
my_list(i) := rec.val;
end loop;
end;

c) DECLARE
MY_LIST1 IdList;
BEGIN
EXP_TYPE ( MY_LIST1);
dbms_output.put_line('COUNT IS '||my_list1.count);
END;

Here I get ORA-06531: Reference to uninitialized collection error on the procedure.

Could you please let me know how to avoid this error ?

thank you,
Madhu
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 23 2007
Added on Feb 23 2007
5 comments
428 views