Exceptions may occur during the execution of a stored program. For example, a program block may exit unexpectedly. You can define exception handlers or specify error codes for warnings and exceptions.
OceanBase Database supports the following PL exception handling statements:
The
DECLARE ... CONDITIONstatement names exception conditions. For more information, see DECLARE … CONDITION.The
DECLARE ... HANDLERstatement declares an exception handler. For more information, see DECLARE … HANDLER.The
RESIGNALstatement modifies the exception information in an exception handler. For more information, see RESIGNAL.The
SIGNALstatement raises an exception condition. For more information, see SIGNAL.The
GET DIAGNOSTICSstatement retrieves information from the diagnostics area. For more information, see GET DIAGNOSTICS.
You can specify how the server chooses an exception handler when an exception occurs. For more information, see Effective scope of an exception handler.
For more information about diagnostics areas, see Diagnostics area.