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;
解决方案 »
- SQLPLUS登录时的问题
- otlv4访问多种数据库方案
- oracle的方案?
- oracle EBS 安装最后验证失败
- 为什么创建类型实体时会报 警告:创建的类型体带有编译错误
- 请问:VMWARE+RHEL5下,如何安装从光盘或硬盘oracle9i呢?
- 怎么定位到倒数第二条记录的数据?
- Oracle中表名和列名有重复的名字,急
- oracle备份文件的恢复问题,不知道原来的版本
- 如何取得截取字符串的值
- 讨论,哪个方法比较好:是用一个自动产生的SEQUENCE ID作为 表的PRIMARY KEY 还是由几个业务字段联合起来做为PRIMARY KEY?
- 请教一个问题?怎么取出8月25日之前的数据,在没有时间字段的情况下。
上面代码中
while item_cur%found
loop
.......
end loop为什么item_cur的值为(Rowcount = 0, %open, %notfound, first iteration)
表里有一条数据啊.