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