You can call the mysql_stmt_error() function to return the error message for the most recently called statement API function.
Syntax
const char *
mysql_stmt_error(MYSQL_STMT *stmt)
Return values
A character string that describes the error is returned. An empty string is returned if no error occurred.
Errors
None.
Notes
For the statement specified by stmt, mysql_stmt_error() returns a null-terminated string containing the error message for the most recently called statement API function that can succeed or fail. An empty string ("") is returned if no error occurred. You can check for errors by using the following tests:
if(*mysql_stmt_errno(stmt))
{
// An error occurred.
}
if (mysql_stmt_error(stmt)[0])
{
// An error occurred.
}
If the failed statement API function was mysql_stmt_close(), do not call mysql_stmt_error() to obtain the error information because mysql_stmt_close() invalidates the statement handler. We recommend that you call mysql_error() instead.
The language of the client error messages may be changed by recompiling the OceanBase client library. You can choose error messages in several different languages.