can we use rowtype in varray?
MillarSep 5 2012 — edited Sep 5 2012i 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