ORA-01403:no data found 解决办法

    背景:在一个存储过程中,调用另一个存储过程,其中有一句话是 select a into b from table;当查询出来的a没有数据时,这个时候就会抛出这个异常:ORA-01403:no data found 。

 

    解决办法:

 

    1:捕获异常,用exception when no_data_found then  处理一下。

 

    2.select count(*) field into var from table where ....

    增加一个count(*)即使没有找到数据,也会返回0,而不是null。

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章