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!

Multidimensional Arrays in PL/SQL

jpvybesOct 28 2010 — edited Oct 28 2010
I'm very familiar with single dimensional arrays such as this:
declare
      type year_type is table of number index by binary_integer;
      year_sales year_type;
      tot_sales   number;
begin
      year_sales(1990) := 34000;
      year_sales(1991) := 45000;
      year_sales(1992) := 43000;

      tot_sales := year_sales(1990) + year_sales(1991) +
year_sales(1992);
      dbms_output.put_line('Total sales: ' || tot_sales);
end;
but I'd like to get a basic understanding of multi-dimensional arrays. As an example, if I have a "claim number" 123456 and two different "field numbers" 2471 and 2472 for that one claim, that contain values ('value1','value2'), could I store them in a multi-dimensional array? Logically, I would like the values to be store something like the following.
multi_array(123456)(2471) := 'value1';
multi_array(123456(2472) := 'value2';
Could someone point me in the right direction with this one with a simple example?

Thank you.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 25 2010
Added on Oct 28 2010
4 comments
8,017 views