ITPub博客

首页 > 应用开发 > IT综合 > 一个测试数组用法的例子

一个测试数组用法的例子

原创 IT综合 作者:chance2000 时间:2006-03-26 00:37:32 0 删除 编辑
一个测试数组用法的例子[@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博客 ” ,链接:https://blog.itpub.net/802415/viewspace-823068/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: sqlplus-help
请登录后发表评论 登录
全部评论
  • 博文量
    78
  • 访问量
    843594