The PL features of OceanBase Database have the following limitations when handling exceptions.
The PL features of OceanBase Database have the following limitations when handling exceptions:
The
SIGNAL,RESIGNAL, andGET DIAGNOSTICSstatements cannot be used in prepared statements. The following example is invalid:PREPARE stmt1 FROM 'SIGNAL SQLSTATE "42000"';SQLSTATEvalues of class '04' are not specially handled. Therefore, they are handled in the same way as other exceptions.In standard SQL, the first condition should be related to the
SQLSTATEvalue returned by the previous SQL statement. However, this is not always guaranteed, so the following statement cannot be used to obtain the main error information:GET DIAGNOSTICS CONDITION 1 @err_no = MYSQL_ERRNO;Instead, we recommend that you use the following method:
GET DIAGNOSTICS @count_no = NUMBER; GET DIAGNOSTICS CONDITION @count_no @err_no = MYSQL_ERRNO;
