ローカルで定義された型を返すローカル パイプライン PL/SQL 関数を作成した後、それを使用する方法が見つかりませんでした。ありますか?ローカルであるとは、関数と型が他の PL/SQL ブロック内でのみ可視であるため、SQL で使用できないことを意味します。
declare
type foo_rec is record (
foo_id number,
foo_date date
);
type foo_tbl is table of foo_rec;
function get_some_foo
return foo_tbl pipelined
is
out_rec foo_rec;
begin
for cur in (
select 1 foo_id, sysdate foo_date from dual
union all
select 2 foo_id, sysdate+1 foo_date from dual
)
loop
out_rec.foo_date := cur.foo_date;
out_rec.foo_id := cur.foo_id;
pipe row(out_rec);
end loop;
end get_some_foo;
begin
null; -- how to use get_some_foo() here?
end;
/