一个测试数组用法的例子[@more@]
create or replace package pk_test is
type array_test is varray(3) of integer;
end pk_test;
/
create or replace procedure test_array(aa in pk_test.array_test)
is
begin
for i in 1..3
loop
dbms_output.put_line(aa(i));
end loop;
end;
/
set serveroutput on
declare
a pk_test.array_test;
begin
a := pk_test.array_test();
a.extend(3);
a(1) := 1;
a(2) := 2;
a(3) := 3;
test_array(a);
end;
/
SQL>
1
2
3
PL/SQL procedure successfully completed
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/802415/viewspace-823068/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/802415/viewspace-823068/