oracle pl/sql 错误处理

oracle pl/sql 异常处理declarebengin--------业务sql--------发生异常捕获的地方exceptionwhen others th

oracle pl/sql 异常处理
declare
bengin

--------业务sql
--------发生异常捕获的地方
exception
   when others then
      DBMS_OUTPUT.put_line('sqlcode : ' || sqlcode);
      DBMS_OUTPUT.put_line('sqlerrm : ' || sqlerrm);
      rollback ;
      --debug日志记录
      str_l_errlog := 'error sqlcode : ' || sqlcode || ' sqlerrm :'||substr(sqlerrm,1,3500);
      if(str_l_debug = 'true') then
          insert into t_errorSql(sqltext) values(str_l_errlog);
      end if;
      commit;
end;
/