create or replace function parent_insert
return number 就是在此处出错.莫名其妙.
aschild_item_no part_temp_bse.item_no_child%TYPE;
parnet_item_no part_temp_bse.item_no_parent%TYPE;
parnet_item_no2 MFG_BOM_MASTER.BKC_CD%TYPE;
cursor item_cur is
select item_no_child,item_no_parent
from part_temp_bse;begin
open item_cur;
fetch item_cur into child_item_no,parnet_item_no;
while item_cur%found
loop
if parnet_item_no is null then
begin
SELECT D.BKC_CD
into parnet_item_no2
FROM (SELECT * FROM MFG_BOM_MASTER
CONNECT BY PRIOR CHILD_ITEM_CD=BKC_CD
START WITH CHILD_ITEM_CD='A1605830A') D,ITEM_MASTER I
WHERE D.BKC_CD=I.ITEM_NO
AND I.ITEM_TYPE=21;
insert into part_temp_bse
( item_no_parent )
values
( parnet_item_no2 );
end;
end if;
end loop;
close item_cur;
return 0;
exception
when others then
if SQL%NOTFOUND then
return -1403;
end if;
return SQLCODE;
end;
return number 就是在此处出错.莫名其妙.
aschild_item_no part_temp_bse.item_no_child%TYPE;
parnet_item_no part_temp_bse.item_no_parent%TYPE;
parnet_item_no2 MFG_BOM_MASTER.BKC_CD%TYPE;
cursor item_cur is
select item_no_child,item_no_parent
from part_temp_bse;begin
open item_cur;
fetch item_cur into child_item_no,parnet_item_no;
while item_cur%found
loop
if parnet_item_no is null then
begin
SELECT D.BKC_CD
into parnet_item_no2
FROM (SELECT * FROM MFG_BOM_MASTER
CONNECT BY PRIOR CHILD_ITEM_CD=BKC_CD
START WITH CHILD_ITEM_CD='A1605830A') D,ITEM_MASTER I
WHERE D.BKC_CD=I.ITEM_NO
AND I.ITEM_TYPE=21;
insert into part_temp_bse
( item_no_parent )
values
( parnet_item_no2 );
end;
end if;
end loop;
close item_cur;
return 0;
exception
when others then
if SQL%NOTFOUND then
return -1403;
end if;
return SQLCODE;
end;
解决方案 »
- 看看这个报错为什么?
- 请教DRIVER={Microsoft ODBC for Oracle} 连接问题!
- ORA-06502: PL/SQL: 数字或值错误
- 我机器上装的是oracle9i,同事机器上是oracle11,我可以连接他机器上的oracle吗,谢谢各位高手指点!
- 关于一条Sql语句 判断期间
- 关于零长度字符串的问题
- 这个存储过程出错了,怎么修改?
- 高分求 weblogic与websphere性能比较 ,oracle与sybase性能比较文档
- oracle建表时如何实现自动编号?
- 有关增加外键的问题,进来看看吧!
- 讨论,哪个方法比较好:是用一个自动产生的SEQUENCE ID作为 表的PRIMARY KEY 还是由几个业务字段联合起来做为PRIMARY KEY?
- 请教一个问题?怎么取出8月25日之前的数据,在没有时间字段的情况下。
上面代码中
while item_cur%found
loop
.......
end loop为什么item_cur的值为(Rowcount = 0, %open, %notfound, first iteration)
表里有一条数据啊.