O'Reilly logo

Oracle PL/SQL For Dummies by Paul Dorsey, Michael Rosenblum

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

Chapter 5

Handling Exceptions

In This Chapter

bullet Exploring exception basics

bullet Discovering types of exceptions

bullet Understanding how exceptions propagate

Almost any program has uncommon situations that need to be handled. These situations are sometimes caused by data entry problems. Imagine that a user enters several pieces of information into an online-book-order application. Maybe one or more pieces of information are missing or incorrectly entered. For example, in the case where the person forgot to indicate the shipping method on their order, the application responds with a user-friendly error message, such as You must enter a shipping method for your order. This is an example of user-defined exception handling in action.

You also want to have a nice way to handle programming errors and exceptions so that users don’t see incomprehensible messages such as Unhandled Program Exception — ORA 600. If you have ever encountered a message such as An unexpected program error has occurred. Please contact the help desk and report this problem, you have experience with a program where the designers tried to come up with a general way to handle unexpected situations.

In PL/SQL, you can handle these ...

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