读书人

请问个存储过程的异常有关问题

发布时间: 2012-04-14 17:14:21 作者: rapoo

请教个存储过程的错误问题
is
str varchar2(8);
begin
select type
into str
from orders
where Yournumbers ='0' and id='3';

insert into ......//这里省略
end D101_text;
---------------
这个存储过程在运行时:第 1 行出现错误: ORA-01403: 未找到任何数据
然后where语句变为where id='3',这样就可以运行。但是Yournumbers ='0' and id='3'条件的记录也是存在的,为什么有“未找到任何数据”的错误呢?
程序中需要用到Yournumbers ='0' and id='3';这两个条件。

[解决办法]
SELECT * from orders
where Yournumbers ='0' and id='3';
这句话你在数据库里能查到数据吗?
如果不能就说明你数据库里就没有满足这2个条件的数据。

读书人网 >oracle

热点推荐