私のパッケージでは、record
タイプと対応するtable
タイプを定義しました。次に、カーソルを開き、各結果をパイプラインで出力しようとするパイプライン関数があります。問題は、型の不一致エラーが発生することです。カーソルを自分のレコード タイプにキャストしようとしましたが、うまくいきませんでした。何が間違っているのでしょうか?
create or replace package myTest as
type myRec is record(
id integer,
foo varchar2(10)
);
type myTable is table of myRec;
function output() return myTable pipelined;
end myTest;
/
create or replace package body myTest as
function output() return myTable pipelined
as
begin
for myCur in (
select id, foo from someTable
)
loop
pipe row(cast(myCur as myRec));
end loop;
return;
end output;
end myTest;
/