我的資料庫版本是Oracle 11GR2
我有3個業務存盤程序sp1,sp2,sp3,1個記錄日志的存盤程序sp_log。
create or replace procedure sp1 as
begin
sp2;
exception when others then
sp_log;
end sp1;
create or replace procedure sp2 as
begin
sp3;
exception when others then
sp_log;
end sp2;
create or replace procedure sp3 as
n number;
begin
n:='a';
end sp3;
現在我用job跑sp1,sp3這里肯定會報錯,那么sp2里面的日志能記到sp3的錯誤資訊,但sp1不會記任何日志啊,就是不會捕捉到sp3的例外,這樣我就不知道sp1為何跑失敗了。請問各位大佬有沒遇到過這種情況,怎么解決的,拜謝!
uj5u.com熱心網友回復:
create or replace procedure sp2 asbegin
sp3;
exception when others then
sp_log;
end sp2;
sp2, 把錯誤都捕捉了,就傳不到 sp1 了。
可以考慮在 sp2 這個程序上,加一個成功標記的引數。
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/70765.html
標籤:開發
