create type data_type_1 as object (x number, y number)
/
create type table_type_1 as table of data_type_1
/
create or replace package xyz AS
function main_xyz return table_type_1 pipelined;
function sub_func return table_type_1 pipelined;
function sub_func1 return table_type_1 pipelined;
end xyz;
/
create package body XYZ AS
function main_xyz return data_type_1 pipelined is
begin
--code
--pipe row(sub_func); --edit_1
FOR rec in (select * from table(sub_func1(x,y))) LOOP
pipe row(rec);
END LOOP;
end;
--function sub_func return data_type_1 pipelined is --edit_1
--begin --edit_1
--code --edit_1
--pipe row(def); --def is data_type_1 --edit_1
--end; --edit_1
function sub_func_1(x in number, y in number) return data_type_1 pipelined is
begin
--code
loop
pipe row(abc); --abc is data_type_1
end loop;
end;
end;
create package body ABC AS
function main_ABC is
begin
--code
FOR rec in (select * from table(main_xyz)) LOOP
pipe row(rec);
END LOOP;
end;
end;
错误,我得到的...嵌套管道函数
误差显示在sub_func1被称为main_xyz块。
[错误] PLS-00382():PLS-00382:表达式是错误的类型
[错误] PLS-00306()的:PLS-00306:错误数量或类型的呼叫参数
[错误] ORA-00904():PL/SQL:ORA-00904::无效标识符
[错误] PLS-00364():PLS-00364:循环索引变量 'REC' 的使用是无效
什么是上面的代码错了?为什么?
@diziaq你怎么看? – user256378