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' 使用无效
上面的代码有什么问题?为什么?