oracle select into 的时候提示未找到数据
2016-07-07 15:50
141 查看
declare version varchar2(50); begin select version into version_id from 表a where 字段 = '1'; --在select into 后面添加exception 错误处理机制 exception when no_data_found then version:= 'hhh '; --以上是处理select into 的时候提示未找到数据的处理方法 if version is null or version ='' then INSERT INTO 表a (字段) select NVL(max(VERSION),0)+1 from 表b ; update 表3 set VERSION = (select NVL(max(VERSION),0) from 表a where 字段 = '1' ) where 字段 = '1'; commit; end if; end;
相关文章推荐
- PL/SQL连接oracle时弹出空白框
- oracle创建索引后sqlldr导入错误
- oracle笔记
- Oracle中union函数
- Oracle 12C优化器的巨大变化,上生产必读(下)
- Oracle 查询类似 select top 的用法
- 自己编写了Oracle EBS程序自动移植脚本
- 12.Oracle存储过程
- MySql递归查询和Oracle递归查询
- MySql递归查询和Oracle递归查询
- oracle 常用函数
- Oracle 跨用户查看视图 权限的分配
- Oracle的光标还有函数
- Oracle 跨用户查看视图
- oracle 实现id自增
- ORACLE OEM
- ORACLE OEM
- ORACLE OEM
- oracle中delect和truncate区别
- Qt5_Oracle