mysql_stmt_sqlstate(3)
β¨ mysql_stmt_sqlstate β¨
okay bestie, welcome to the MariaDB Connector/C manual page for mysql_stmt_sqlstate β she's the one who tells you what went wrong with your last prepared-statement call, in fancy ANSI-approved error-code language π
πΈ Name πΈ
mysql_stmt_sqlstate β returns the SQLSTATE error from the previous statement operation. no cap, that's literally her whole job π«Ά
π Synopsis π
#include <mysql.h>
const char * mysql_stmt_sqlstate(MYSQL_STMT * stmt);
π Description π
She hands you back a string containing the SQLSTATE error code for the most recently invoked prepared statement function that can succeed or fail. like, the last one that had opinions π
π¦ Parameter
* stmtβ a statement handle, which was previously allocated bymysql_stmt_init(3). gotta have one of those first, babe, it's the vibe check of entry requirements β¨
π Return value
Returns a 5 digit error code β five whole digits of truth π
00000 means no error. iconic. the "we're so back" of error codes π
The values are specified by ANSI SQL and ODBC.
β Notes β
please note that not all client library error codes are mapped to SQLSTATE errors. lowkey tragic but that's the tea π
Errors which can't be mapped will be returned as the value HY000. so if you see that, it's giving "this error didn't get a costume for the ball" π
π₯ See Also π₯
the whole squad, fr fr π
Version 3.4 of this lil page, and that's the whole manual entry β thanks for reading my unhinged but extremely accurate documentation, mwah πβ¨ππ¦πΈπ π«Άππ
π¦ where this page comes from
- alpine 3.22: mariadb-doc 11.4.13-r0 Β· GPL-2.0-or-later
- alpine 3.23: mariadb-doc 11.4.13-r0 Β· GPL-2.0-or-later
- alpine 3.24: mariadb-doc 11.8.9-r0 Β· GPL-2.0-only
- arch rolling: mariadb 13.0.2-2 Β· GPL-2.0-only
- arch rolling: mariadb-lts 12.3.3-2 Β· GPL-2.0-only
- centos-stream 10: mariadb-connector-c-doc 3.4.4-2.el10 Β· LGPL-2.1-or-later
- debian trixie: libmariadb-dev 1:11.8.6-0+deb13u1 Β· GPL-2.0-only
- fedora 43: mariadb-connector-c-doc 3.4.5-2.fc43 Β· LGPL-2.1-or-later AND PHP-3.0 AND PHP-3.01
- fedora 43: mariadb-connector-c-doc 3.4.9-2.fc43 Β· LGPL-2.1-or-later AND PHP-3.0 AND PHP-3.01 AND LicenseRef-Fedora-Public-Domain
- fedora 44: mariadb-connector-c-doc 3.4.8-3.fc44 Β· LGPL-2.1-or-later AND PHP-3.0 AND PHP-3.01
- fedora 44: mariadb-connector-c-doc 3.4.9-2.fc44 Β· LGPL-2.1-or-later AND PHP-3.0 AND PHP-3.01 AND LicenseRef-Fedora-Public-Domain
- nixpkgs unstable: mariadb-server 11.8.8
- opensuse-leap 16.0: libmariadb-devel 3.4.9-160000.1.1 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: libmariadb-devel 3.4.9-160000.1.1 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: libmariadb-devel 3.4.9-160000.1.1 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: libmariadb-devel 3.4.9-160000.1.1 Β· LGPL-2.1-or-later
- ubuntu questing: libmariadb-dev 1:11.8.3-1build1
- ubuntu resolute: libmariadb-dev 1:11.8.6-5 Β· GPL-2.0-only
- ubuntu resolute: libmariadb-dev 1:11.8.6-5ubuntu0.1 Β· GPL-2.0-only
- ubuntu stonking: libmariadb-dev 1:11.8.9+ds-4ubuntu2 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms