exception
when sql%notfound then
....

解决方案 »

  1.   

    加个判断不就行了
    select count(*) into i from ..
    if i>0 then
    ...
    else
    ...
      

  2.   

    试试,还没测试.
    select 字段 into 变量 from table_name a where exists(select 字段 from table_name where id=a.id)
      

  3.   

    select nvl(a,0) into b from table where ...
      

  4.   

    select nvl(a,0) into b from table where ...或者用异常处理exception
    when sql%notfound then
    ....
      

  5.   

    SELECT 的异常处理应该用 NO_DATA_FOUND 来捕捉!
      

  6.   

    begin
        select ...;
        exception when no_data_found then
          ...;
    end;