mysql_stmt_sqlstate(3)

πŸ“¦
version 13.0.2 Β· 4 versions
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, centos-stream 10, debian trixie, fedora 43, fedora 44, nixpkgs unstable, opensuse-leap 16.0, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ 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 by mysql_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