使用SQL游标属性
SQL%ROWCOUNT

解决方案 »

  1.   

    begin
       insert ...
    exception
    when others then
    -- 出错处理   
       ...
    end
      

  2.   

    maohaisheng太勤劳了,不过说的没错,我这里再补充补充.
    大体有如下几个:
    1、sql%found、sql%notfound,以sql%found为例,在语执行之前为null,当语句执行后,sql%found为有如下属性:
    insert成功会返回true
    delete或update至少一行记录也会返回true
    select into选到了数据
    2、可以用sql%rowcount属性,也不用细说了,当语句影响到了或返回了数据也就会返回相应的行数。
    3、sql%isopen,这个和你的问题无关了,它是用于判断游标是否打开了。
      

  3.   

    可以用 WHENEVER SQLERROR...... 来处理呀,具体用法要看你程序设计的目的以及实现的方法代码,可以去看一下ORACLE自带的帮助,很好用的:-)
      

  4.   

    create or replace function name_f
    return varchar2
    as
    str varchar2(10);
    begin
      begin 
      insert into a values(...);
      exception
      when others then
      return ...;
      end;
      begin 
      insert into b values(...);
      exception
      when others then
      return ...;
      end;
    end;
      

  5.   

    不成功的话,会报错的,直接exception了