Two dimensional array in pl sql oracle
Posted by Raj
Two dimensional array in pl sql oracle.
In this tutorial,I will explain how to create Two dimensional array in pl sql oracle.In PL/SQL Oracle developers can store information in arrays.
PL/SQL tables have a two properties
1.Uunbounded
2.Sparse.
Example: Two dimentional array in PL/SQL
DECLARE
array2 array2Type;
BEGIN
array2 := new array2Type(array1( A,B,C,D,E,F,G,H),array1( I,J,K,L,M,N,O,P));
DBMS_OUTPUT.PUT_LINE('Two dimensional array in pl sql oracle:');
for a1 in 1..array2.Count
LOOP
for a2 in 1..array2(a1).Count
LOOP
DBMS_OUTPUT.PUT(rpad(array2(a1)(a2),4));
END LOOP;
DBMS_OUTPUT.PUT_LINE('');
END LOOP;
END;
Output:
Two dimensional array in pl sql oracle:
A B C D E F G H
I J K L M N O P
In this tutorial,I will explain how to create Two dimensional array in pl sql oracle.In PL/SQL Oracle developers can store information in arrays.
PL/SQL tables have a two properties
1.Uunbounded
2.Sparse.
Example: Two dimentional array in PL/SQL
DECLARE
array2 array2Type;
BEGIN
array2 := new array2Type(array1( A,B,C,D,E,F,G,H),array1( I,J,K,L,M,N,O,P));
DBMS_OUTPUT.PUT_LINE('Two dimensional array in pl sql oracle:');
for a1 in 1..array2.Count
LOOP
for a2 in 1..array2(a1).Count
LOOP
DBMS_OUTPUT.PUT(rpad(array2(a1)(a2),4));
END LOOP;
DBMS_OUTPUT.PUT_LINE('');
END LOOP;
END;
Output:
Two dimensional array in pl sql oracle:
A B C D E F G H
I J K L M N O P
This entry was posted on October 4, 2009 at 12:14 pm, and is filed under
2 dimensional array in pl/sql,
array in plsql,
multi-dimensional arrays,
varray(2)
.You can leave a response, or trackback from your own site.