Examples of one-dimensional arrays are:
--Created on 2014-5-15 by Administratordeclare TYPE Arr1 is Varray (ten) of number; Tab_1 Arr1; TYPE ARR2 is TABLE of number INDEX by Binary_integer; Tab_2 Arr2; BEGIN -Test statements here tab_1: = ARR1 (1, 3, 4, 6, 3, 2, 8, 5); For a in 1.. Tab_1.count LOOP dbms_output.put_line ("| | Tab_1 (a)); END LOOP; Tab_2 (1): = 101; Tab_2 (2): = 102; Tab_2 (3): = 103; Tab_2 (4): = 104; For B in 1.. Tab_2.count LOOP dbms_output.put_line ("| | Tab_2 (b)); END LOOP; END;
Results:
13463285101102103104
Example of a two-dimensional array :
--Created on 2014-5-15 by Administratordeclare – Local variables here TYPE Array1 is Varray () of number; TYPE Array2 is Varray (ten) of Array1; ARR Array2; BEGIN ARR: = Array2 (Array1 (one, one, up, and above), Array1 (+, A, ()); For I in 1.. Arr.count Loop for J in 1.. ARR (i). Count LOOP dbms_output.put_line (ARR (i) (j)); END LOOP; END LOOP; END;
Results:
11121314152122232425
This article is from the "Long Way to repair ..." Blog, be sure to keep this source http://baser.blog.51cto.com/4153192/1411997