We cannot say that the code is robust until it can handle all the exceptions. Bugs and abrupt termination of a program are the nightmares of a programmer’s life. No programmer wants to develop a code which will crash in a midway or behave unexpectedly. Thus for the smooth execution of a software it is necessary to handle all kinds of exceptions.
Knowing your problem is the first step towards finding its solution. So let’s learn more about exception handling in Oracle database.
Exceptions are designed for run time error handling rather than compile time error handling. Errors that occur during compilation phase are detected by the PL/SQL compiler and reported back to the user.
System defined exceptions majorly have a negative error code and error message. These errors have a short name which is used with the exception handler.
Oracle avails two utility functions SQLCODE & SQLERRM to retrieve the error code and message for last occur exception.
That’s it for this section. Hope you enjoyed reading this brief introduction to exception handling in Oracle Database. In this blog I tried to answer a few questions which you can expect in your Oracle Database Certification as well as in the Interview. Stay tuned as in the next tutorial we will do some cool examples explaining the above mentioned concepts which will help you in enhancing your knowledge and give you a strong hold on the concepts of PL/SQL exception handling.
If you find this blog helpful and learnt something new then do make sure to Share this with your friends on your social media. Also you can send your suggestions on my twitter @RebellionRider [official twitter handle]. Have a great day!
You can DOWNLOAD SQL script and presentation used in the Video and in this article.