Home > database >  The function of the stored procedure logging the exception
The function of the stored procedure logging the exception

Time:09-24

My database version is Oracle 11 gr2
I have three business stored procedure sp1, sp2, sp3, a logging stored procedures sp_log,
The create or replace procedure sp1 as
The begin
Sp2.
Exception when others then
Sp_log;
End sp1.

The create or replace procedure sp2 as
The begin
Sp3;
Exception when others then
Sp_log;
End sp2.

The create or replace procedure sp3 as
N number;
The begin
N:='a';
End sp3;

Now I use the job run sp1, sp3 here would be an error, then the inside of the sp2 log can remember to sp3 error messages, but sp1 remember no log, is not capture the sp3 abnormalities, so I don't know why sp1 run failed, excuse me, have not encountered this kind of situation, how to solve, thank humbly!

CodePudding user response:

The create or replace procedure sp2 as
The begin
Sp3;
Exception when others then
Sp_log;
End sp2.

Sp2, the errors are captured, we won't be able to pass a sp1,

Consider on the sp2 this process, the parameters of the marked a successful,
  • Related