create or replace type type_row as object
(
id int,
name varchar(50)
)
create or replace type type_table is table of type_row;
------------创建简单的函数
返回tble
create or replace function f_tests(s number)
return type_table pipelined
as
v_type_row type_row;--行
begin
for i in 1..s loop
v_type_row:= type_row(i,to_char(i*i));
pipe row(v_type_row);
end loop;
return;
end f_tests;