After execution code below:
declare
type arr_countries is varray(5) of countries%rowtype;
cursor cur is
select * from (
select * from hr.COUNTRIES order by COUNTRY_NAME desc)
where rownum <6;
ac arr_countries :=arr_countries();
begin
for cv in cur loop
ac := cv;
end loop;
dbms_output.put_line('test');
end;
Oracle returns:
Error report -
ORA-06550: line 10, column 7:
PLS-00382: expression is of wrong type
ORA-06550: line 10, column 1:
PL/SQL: Statement ignored
06550. 00000 - "line %s, column %s:\n%s"
*Cause: Usually a PL/SQL compilation error.
*Action:
Why I cannot copy selected row to rowtype array field?