请教一个问题,对于表我要判断是不是存在这样的数据,如果不存在则raise一个异常.但是我在数据库中间 用以下语句:
select 1 from emp where emp_id = x;
if sql%found then raise ....;
这样不行呢,难道非要 select count(*) into a ;
if a<1 then 这样老土的写法么?有的同学说可以
select 1 from emp where emp_id = x;
if sql%notfound then raise ..
当时我测试了下,还是不会出现 期望的raise的结果.
select 1 from emp where emp_id = x;
if sql%found then raise ....;
这样不行呢,难道非要 select count(*) into a ;
if a<1 then 这样老土的写法么?有的同学说可以
select 1 from emp where emp_id = x;
if sql%notfound then raise ..
当时我测试了下,还是不会出现 期望的raise的结果.
解决方案 »
- 存储过程改了N次,仍然出错后,我来了............
- 如何在oracle数据库中查询xml节点的值
- asp.net连接Oracle8.0.5 数据库后,有些时候为什么Update语句会执行无效?
- 重启ORACLE服务遇到的问题 错误代码183
- 不能把超过 4000 字节数据绑定到语句 1 中的 LOB 和 LONG
- 数据库转移
- ?一个存储过程
- 请教各位,哪里有介绍分布式数据库系统比较深入的网站或者论坛!
- 为什么有的进程杀不死?
- 我的这个存储过程报pls00103:Encountered the symbol "b_cur " when exception one of the fol
- 如何写这样的sp?
- ORACLE行列转换问题
insert,update,select into 后面可以