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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Array of Arrays 1

Status
Not open for further replies.

CIMTEET

Programmer
Jun 25, 2001
182
US
I am very new to the oracle world and was reading up on how to combine a couple of For loops using an array of arrays. How do you do that for one? I can't seem to find a user defined type that will allow me to do this. Varrays seem to be single dimensional. I have about 9 variables and 11 different cases that use these Vars under different circumstances. I would like to in the loop roll through case one and populate variables, then case two and so on by incrementing a counter. Is there another way to do this. I know it seems vague...

Thanks
Greg
 

You could try something similar to this example:
Code:
set serverout on size 1000000;
declare
type a is table of number(5) index by binary_integer;
type b is table of a index by binary_integer;
array2 b;
i pls_integer;
j pls_integer;
begin
  for i in 1..10
  loop
    for j in 1..10
    loop
      array2(i)(j):=i*100+j;
      dbms_output.put_line('elem('||i||','||j||')='||array2(i)(j));
    end loop;
  end loop;
end;
[3eyes]


----------------------------------------------------------------------------
The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top