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!

Copying cursor to varray

jerry44May 24 2015 — edited May 25 2015

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?

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 22 2015
Added on May 24 2015
8 comments
1,864 views