Because condition Handlers are optional, you can have the caller of a procedure handle any error condition by not coding any handlers. When an error is then encountered, your procedure backs out any maintenance it performed and aborts. You need handlers for NOT FOUND and SQLWARNING, however, if you do not want completion codes to cause a procedure to abort, for example if you have an SQLSTATE '02000' or SQLCODE 100 at the end of each cursor and (or) warning conditions such as when an SQLSTATE starts with '01' or there is a positive SQLCODE. For an example showing a procedure without handlers, see Sample Procedure 1.
|
Copyright © 2014 CA.
All rights reserved.
|
|