首页 > 数据库技术 > 详细

oracle存储过程出现ORA-01403: 未找到数据 问题解决方法

时间:2019-04-16 12:34:09      阅读:594      评论:0      收藏:0      [点我收藏+]

这段时间在做一个业务,需要用到存储过程处理业务逻辑,但是出现一个ORA-01403: 未找到数据 问题,

那么这个应该如何解决这个问题

declare mixType integer;
begin
   --原先获取方式--
   select NVL(MID,0) into mixType from DXC_MIXTYPE where Name=常温111 and RowNum=1;
end;

如果根据条件找不到,是无法赋值到mixType中的

技术分享图片

解决方法我采用这种处理方式

declare mixType integer;
begin
  --默认如果找不到,默认给0值---
  select count(*) into mixType from DXC_MIXTYPE where Name=常温111 and RowNum=1;
  if mixType>0 then
    select NVL(MID,0) into mixType from DXC_MIXTYPE where Name=常温111 and RowNum=1;
  end if; 
end;

Ps:

参考网址来源: https://blog.csdn.net/u010999809/article/details/80663895

oracle存储过程出现ORA-01403: 未找到数据 问题解决方法

原文:https://www.cnblogs.com/xielong/p/10716078.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!