O'Reilly logo

Oracle Database 10g: A Beginner's Guide by Michael Corey, Michael Abbey, Ian Abramson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CRITICAL SKILL 6.5

Handle Error Conditions in PL/SQL

As we have seen in the previous section, bad things happen to good programs. However, you also have to deal with bad or problematic data as well. To deal with problems during the processing of data, PL/SQL provides us with the robust ability to handle these types of errors. We call this type of program code exception handling.

To raise an error from with in a PL/SQL program, use the built-in function named raise_application_error. The function requires two arguments. One is for the error number. This number must be between –20000 and –20999. The second argument is the error that you want the user to see.

As with all exception handling, this program code is placed into the EXCEPTION section ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required