plsql函数返回数组集合例子
时间:2021-07-01 10:21:17
帮助过:3人阅读
create or replace type t_test
as object(
2 id
integer,
3 rq date,
4 mc
varchar2(
60)
5 );
6
7 create or replace type t_test_table
as table of t_test;
8
9 create or replace function f_test_array(n
in number default null)
return t_test_table
10 as
11 v_test t_test_table :
= t_test_table();
12 begin
13 for i
in 1 .. nvl(n,
100) loop
14 v_test.extend();
15 v_test(v_test.
count) :
= t_test(i,sysdate,
‘mc‘||i);
16 end loop;
17 return v_test;
18 end f_test_array;
19
20
21 select * from table(f_test_array(
10));
plsql函数返回数组集合例子
标签:返回 nvl creat begin har create 集合 def int