on 10-20-2020 11:42 PM
We have created a really long procedure which runs 100+ checks on a transaction. It is of the following form:
if check1
then error_message := 'Error 1';
end if;
if check2
then error_message := 'Error 2';
end if;
However, I want to optimize the execution of these checks. Right now, even if check1 fails, the procedure executes all of the remaining checks. Can we write a "Go to End" sort of code which can simply end skip ahead to the end of the procedure if it encounters an error? E.g.
if check1
then error_message := 'Error 1';
go to <end>
end if;
if check2
then error_message := 'Error 2';
go to <end>
end if;
One opton would be to declare an exit handler and raise a user-defined exception when a condition is not fulfilled.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.