fetch mycur into v_code;
exit when mycur%NOTFOUND;
if() then
在循环中
为什么语句会报01423错误
Select N_S into N_S_DATA from ben_sve_merge where CELLCODE = v_code; --v_code 定义变量
end if;
PS: 循环插入数据库 单写 存储过程可以执行 放到package 就无法执行了?
------解决方案--------------------
Select N_S into N_S_DATA from ben_sve_merge where CELLCODE = v_code;
这里是不是返回多行了
查一下cellcode是否有重复
select cellcode from ben_sve_merge group by cellcode having count(1)>1;
------解决方案--------------------
Select N_S into N_S_DATA from ben_sve_merge where CELLCODE = v_code;
你这个查询是不是有多个纪录值。
------解决方案--------------------
这个错误是检查实际读取的多余行时会报错!楼主仔细看下表。
------解决方案--------------------
很有可能是以下语句返回了多条记录导致报错:
Select N_S into N_S_DATA from ben_sve_merge where CELLCODE = v_code;
------解决方案--------------------
具体的过程,和放入包后的执行代码?
------解决方案--------------------
是有重复的,楼主表里面查查看呗!
------解决方案--------------------
cursor cs is select * from table后面加上分号
包体定义后面少个end;
------解决方案--------------------
where条件过滤后多于一条数据
------解决方案--------------------
直接
insert into table (xxx,xxx,xxx) select xxx,xxx,xxx from table不行么,为什么要用游标?