Collection review
Dipali, May 25, 2017 - 7:01 am UTC
in type declaration you have used %rowtype and in Type variable you are using single column (name).
%rowtype will expect row to be fetch in variable.
declare
type tt is table of DEMO_TAGS.content_type %type index by binary_integer;
vt tt;
begin
for i in (select id from DEMO_TAGS) loop
select content_type bulk collect into vt from DEMO_TAGS where id=i.id;
for j in vt.first..vt.last loop
dbms_output.put_line(vt(j));
end loop;
end loop;
end;
Results
PRODUCT
PRODUCT
CUSTOMER
CUSTOMER
CUSTOMER
ORDER
ORDER
ORDER
ORDER
ORDER
ORDER
ORDER
ORDER
ORDER
Statement processed.
0.14 seconds