I am struggling a little understanding how this is done, and would really appreciate if someone could walk me through how a 2d array in PL/SQL is made?
-
possible duplicate of Creating or simulating two dimensional arrays in PL/SQLuser247702– user2477022014-04-06 23:20:28 +00:00Commented Apr 6, 2014 at 23:20
-
See Multidimensional Collections from Oracle's PL/SQL Collections and Records. There is three different examples.user272735– user2727352014-04-07 08:57:24 +00:00Commented Apr 7, 2014 at 8:57
Add a comment
|
1 Answer
You can think of the following code as each row in table2 has a collection of type table1. You can insert any number of values as is shown in BEGIN.
DECLARE
TYPE table1 IS TABLE OF NUMBER
INDEX BY PLS_INTEGER;
TYPE table2 IS TABLE OF table1
INDEX BY PLS_INTEGER;
var_i table2
BEGIN
var_i (1) (1) := 1;
var_i (1) (2) := 12;
END;