SQL> create or replace type myvarray_list as varray(10) of varchar2(50);
2 /
类型已创建。
SQL> create or replace procedure show_list(
2 p_varlist in myvarray_list
3 )
4 is
5 str varchar2(50);
6 begin
7 for x in 1..p_varlist.count loop
8 dbms_output.put_line('p_varlist('||x||')='||p_varlist(x));
9 end loop;
10 end;
11 /
过程已创建。
SQL> exec show_list(myvarray_list('Oracle','DB2','Sql Server','mySql','DBA'));
p_varlist(1)=Oracle
p_varlist(2)=DB2
p_varlist(3)=Sql Server
p_varlist(4)=mySql
p_varlist(5)=DBA
PL/SQL 过程已成功完成。
SQL>