原因:select a into b from table;當查詢出來的a沒有數據時,這個時候就會拋出這個異常:ORA-01403:no data found
解決方法:
先定義一個整形變量,countA,增加一個count(*)即使沒有找到數據,也會返回0,而不是null;然后再判斷countA是否大於0,如果大於0,則再執行上面的語句
declare
countA integer :=0;
select count(*) into countA from table;
if countA>0 then
select a into b from table;
end if;