更新时间:2022-03-24 22:32:09
只需用begin-end;
begin
-- your faulty statement here
Exception
When NO_DATA_FOUND Then
-- Do what you want or nothing
WHEN TOO_MANY_ROWS THEN
-- what if you get more then one row? and need specific handler for this
When OTHERS Then
-- do something here or nothing (optional - may happen if you have more than your SELECT INTO between 'begin' and 'Exception')
end;
这就像PL/Sql
的try
块
使用这种技术,您可以记录语句失败的原因.
With this technique you can log the reason your statement failed.