Special circumstances may arise during the execution of stored programs that require handling, such as exiting the current program block. You can define handlers for warnings or exceptions, or specify error codes.
OceanBase AI Database supports the following PL exception handling statements:
The
DECLARE ... CONDITIONstatement is used to name an exception condition. For more information, see DECLARE ... CONDITION.The
DECLARE ... HANDLERstatement is used to declare a handler. For more information, see DECLARE ... HANDLER.The
RESIGNALstatement is used to modify the exception information in an exception handler. For more information, see RESIGNAL.The
SIGNALstatement is used to raise an exception. For more information, see SIGNAL.The
GET DIAGNOSTICSstatement is used to retrieve information from the diagnostic area. For more information, see GET DIAGNOSTICS.
Information on how the server selects handlers in case of an exception. For more information, see Scope of handlers.
For information about the diagnostic area, see Diagnostic section.