时间:2021-07-01 10:21:17 帮助过:15人阅读
2>创建函数返回上面定义的类型
create or replace function f_pipe(s number) return t_table pipelined as v_number number; begin for i in 1..s loop v_number := i; pipe row(v_number); end loop; return; end f_pipe; ;
3>测试
select * from table(f_pipe(5))
1>创建一个表类型(有多个列)
create or replace type obj_table as object ( id int, name varchar2(50) )
2>创建函数返回上面定义的类型
create or replace function f_pipe(s number) return t_table pipelined as v_obj_table obj_table; begin for i in 1..s loop v_obj_table := obj_table(i,to_char(i*i)); pipe row(v_obj_table); end loop; return; end f_pipe;
3>测试
select * from table(f_pipe(5))
Oracle管道函数(Pipelined Table Function)实现的实例
标签:line 测试 func nbsp 一点 object code name creat