Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to organizing exit errors in packages?

Blue BirdMar 7 2018 — edited Mar 8 2018

Hi,

I would like to know what is good practice with handling exit errors and PL/SQL packages. How you approach to this situation when you have a project?

For example that I have multiple packages with different procedures. If procedure exit normally I return exit_Code 0 over out parameter, which mean that all went Ok. If I handle (check on my own) some errors inside, this numbers are positive and I also return exit_Message which tell the user what went wrong. And unhandled errors have negative values (catched in Exception clause).

Question is how to numbering this numbers now? Should I number them from 1 to last number globally I have in all packages or start in each package from 1 to last number? I see advantage in this approach that when user tell you error code you know exactly where this happen if you have some general list of error codes for this project. But some errors could be same in different packages, but with different numbers. Or maybe is better and more efficient to do this on some other easier way.

What would be your suggestion and good practice you would recommend to someone new on this area, that it won't have headache at later time? All suggestions and replies are welcome.

Thank you,

BB

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 5 2018
Added on Mar 7 2018
18 comments
1,711 views