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' の使用が無効です
上記のコードで何が間違っていますか? なぜ?