背景:在一個存儲過程中,調用另一個存儲過程,其中有一句話是 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。