For the complete documentation index, see llms.txt. This page is also available as Markdown.

mysql_stmt_sqlstate

mysql_stmt_sqlstate returns the five-character SQLSTATE error code for the most recently invoked prepared statement function, with '00000' indicating no error occurred.

Syntax

const char * mysql_stmt_sqlstate(MYSQL_STMT * stmt);

Parameter

Description

Returns a string containing the SQLSTATE error code for the most recently invoked prepared statement function that can succeed or fail. The error code consists of five characters. '00000' means no error. The values are specified by ANSI SQL and ODBC.

Return Value

Returns a 5 digit error code. '00000' means no error. The values are specified by ANSI SQL and ODBC.

Please note that not all client library error codes are mapped to SQLSTATE errors. Errors which can't be mapped will returned as value HY000.

See Also

This page is: Copyright © 2026 MariaDB. All rights reserved.

spinner

Last updated

Was this helpful?