Skip to Main Content

Oracle Database Discussions

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!

can we use rowtype in varray?

MillarSep 5 2012 — edited Sep 5 2012
i am trying to use a rowtype as a content of varray, i am trying to fetch collection of information from employees table using the bulk collect and trying to assign it to a variable created by the varray datatype, but i am getting this error?

error:
ORA-06532: Subscript outside of limit

code:

declare
type abc is varray(400) of employees%rowtype;
v_emp abc;
x number:=1;
begin
v_emp:=abc();
select * bulk collect into v_emp from employees;
loop
v_emp.extend();
dbms_output.put_line(v_emp(x).employee_id);
x:=v_emp.next(x);
exit when x is null;
end loop;
end;
/

help me out with this solution to the above query?

also tell me
1. whether we can able to store multiple column values to a variable using varray
This post has been answered by Mark Malakanov (user11181920) on Sep 5 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 3 2012
Added on Sep 5 2012
8 comments
946 views