在我的包中,我定义了一个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;
/