Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Array of Array

Status
Not open for further replies.

engineer2100

Programmer
Feb 7, 2002
285
US
Hi All,

Is it possible to have Array of Arrays in Oracle? Extrnding this, can it be used in the FORALL statement for Bulk Operations?

Thanks
Engi

 
Yes. You can have varray or varray and likewise for all other collection types. You can even have intermixed, for example, a varray of a nested table.

Code:
declare
 type t1 is varray(10) of integer;
 type nt1 is varray(10) of t1; -- multilevel varray type
 va t1 := t1(2,3,5);
-- initialize multilevel varray
 nva nt1 := nt1(va, t1(55,6,73), t1(2,4), va);

I haven't used multilevel arrays myself in Bulk operations, but I haven't read any restrictions regarding using FORALL etc. for multilevel arrays.

Check the PL/SQL documentation for details.

HTH
 
How do I access the elements in a loop?

Thank you very much ...

Engi
 
Code:
for i in 1..3
loop
   for j in 1..3
   loop
      value1 := nva(i)(j);
      dbms_output.put_line(value1);
   end loop;
   va1 := nva(i);
   dbms_output.put_line(value1);
end loop;

Of course, you would need to have valid values in the subscripted elements.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top