1. If i declare record , then define nested table of record type and then using bulk collect i can fetch data into nested table which is correct
Eg
declare
type abc_rec is record (f_name tbl_member_contact.first_name%type, l_name tbl_member_contact.last_name%type);
type nst is table of abc_rec ;
v_ret nst ;
cursor c1 is select first_name,last_name from tbl_contact where code='DD';
c_limit pls_integer :=20 ;
begin
open c1;
loop
fetch c1 BULK COLLECT into v_ret limit c_limit;
EXIT WHEN v_ret.COUNT = 0;
end loop;
close c1;
end;
2. But If i declare object and use in anonymous block and then using bulk collect , i am not able to get output giving mismatch error .
Eg.
create type nested_type as object (first_name varchar2(100),last_name varchar2(200)) ;
create type nested_type1 is table of nested_type;
declare
v_ret nested1_type;
cursor c1 is select first_name,last_name from tbl_contact where code='DD';
c_limit pls_integer :=20 ;
begin
open c1;
loop
fetch c1 BULK COLLECT into v_ret limit c_limit;
EXIT WHEN v_ret.COUNT = 0;
end loop;
close c1;
end;
Thanks in Advance
Regards,
Aman