日期:2014-05-17  浏览次数:20685 次

请教个存储过程的错误问题
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个条件的数据。