Chapter 6. Condition Handling
In this chapter, you will learn
SQLSTATEare and their differences
What a condition handler is, how and when to best use it, its range and scope, and how to work with multiple handlers
How to force an application or user-defined exception, and set the appropriate message tag to go along with it
Various ways of returning errors, and how to check the success and/or failure of a stored procedure call
Any textbook that deals with the subject of writing code is not complete without a discussion on how to process errors and other conditions. Anticipating and handling conditions is part and parcel of good, robust programming style. With DB2 SQL procedures, this is accomplished through the use of condition handlers. ...