Error Handler

Home Up

 

Introduction to Error handler

    Error Handler are the fifth type of DML_HANDLER.  They differ from the mainstream  DML_HANDLER in that they are called only when the apply process cannot succeed. 
The following table show the difference in usage between the two :

 
Type of handler When Frequency Comments
DML_HANLDER Before Apply ALWAYS called  
ERROR_HANLDER After Apply ONLY case of problems error_handler column must = TRUE

 

In short an Error_handler is called AFTER and CASE OF while a DML_HANDLER is called ALWAYS

It is important to note that you cannot have a DML handler and an error handler simultaneously for the same operation on the same table.

An error handler is a procedure that must be of the following Signature:

PROCEDURE user_procedure ( evt               IN SYS.AnyData,
                           error_stack_depth IN NUMBER,
                           error_numbers     IN DBMS_UTILITY.NUMBER_ARRAY,
                           error_messages    IN emsg_array);