天天看点

PL/SQL常捕获的异常

SELECT INTO 可能引发的两个异常:NO_DATA_FOUND,TOO_MANY_ROWS

  • NO_DATA_FOUND

      A SELECT INTO statement returns no rows, or your program references a deleted element in a nested table or an uninitialized element in an index-by table. SQL aggregate functions such as AVG and SUM always return a value or a null. So, a SELECT INTO statement that calls an aggregate function never raises NO_DATA_FOUND. The FETCH statement is expected to return no rows eventually, so when that happens, no exception is raised.    

  • TOO_MANY_ROWS

    A SELECT INTO statement returns more than one row.

 出处 ;http://hi.baidu.com/yunfanleo/blog/item/7f8836f7922e5521730eec4f.html