oracle函数问题,请看下哪里错了

create or replace type "BOM_ROW" AS OBJECT(
Father NVARCHAR2(10),
FatherCode NVARCHAR2(10),
ItemCode NVARCHAR2(10),
ItemName NVARCHAR2(10),
Quantity NVARCHAR2(10)
)
create or replace type "BOM_TAB" AS TABLE OF bom_row;

create or REPLACE function functest(Fid NVARCHAR2)
return bom_tab
IS
sCount number;
v bom_tab:=bom_tab;

cursor bom_cursor is SELECT DISTINCT Fid,FatherCode,ItemCode,ItemName,QUANTITY
FROM (
SELECT   FatherCode,S1.ItemCode,S2.ItemName,QUANTITY FROM (select FatherCode,ItemCode,ItemName,QUANTITY from SMS_UDPBOM o start with o.ItemCode=Fid connect by prior o.ItemCode=o.FatherCode) S1 
LEFT JOIN SMS_UDPITEM S2 ON S1.ItemCode=S2.ItemCode 
) A  
WHERE  NVL(FatherCode,'0')<>'0';

cursor bom_cursor_none is SELECT DISTINCT Fid,FatherCode,ItemCode,ItemName,QUANTITY
FROM (
SELECT   S1.ItemCode FatherCode,S1.ItemCode,S1.ItemName,1 QUANTITY FROM SMS_UDPITEM S1 Where ItemCode =Fid
) A  
WHERE  NVL(FatherCode,'0')<>'0';

BEGIN

for c in bom_cursor loop
    v.extend;
    v(v.count):=c;
end loop;

if v.count=0 then
     for c in bom_cursor_none loop
        v.extend;
        v(v.count):=c;
     end loop;
end if;

END;

错误(4,7): PL/SQL: Item ignored
错误(4,16): PLS-00330: 无效的类型名用法或子类型名用法
错误(21,9): PLS-00320: 此表达式的类型声明不完整或格式不正确
错误(21,9): PL/SQL: Statement ignored
错误(22,9): PLS-00320: 此表达式的类型声明不完整或格式不正确
错误(22,9): PL/SQL: Statement ignored
错误(25,5): PL/SQL: Statement ignored
错误(25,8): PLS-00320: 此表达式的类型声明不完整或格式不正确
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!