请教一个问题,对于表我要判断是不是存在这样的数据,如果不存在则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的结果.