mysql_stmt_store_result(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

✨ NAME ✨

mysql_stmt_store_result β€” bestie, this one transfers a result set from a prepared statement πŸ’–

Okay so this is a page from the MariaDB Connector/C manual, and we're gonna get you fluent in it, no cap.


🌸 SYNOPSIS 🌸

#include <mysql.h>

int mysql_stmt_store_result(MYSQL_STMT * stmt);

πŸ¦‹ DESCRIPTION πŸ¦‹

The way this works is lowkey specific, so listen up 🫢

You must call mysql_stmt_store_result() for every query that successfully produces a result set β€” but only if you want to buffer the complete result set by the client, so that the subsequent mysql_stmt_fetch(3) call returns buffered data.

Like, that "only if" is doing so much heavy lifting here. No result set? No need. Don't wanna buffer client-side? Also no need. But if you do want your mysql_stmt_fetch(3) handing you buffered data, then yes bestie, you're calling this. Periodt. πŸ’…


πŸŽ€ PARAMETER πŸŽ€


πŸ‘‘ RETURN VALUE πŸ‘‘

Returns zero on success, nonzero if an error occurred. That's it, that's the whole vibe check.

πŸ’œ NOTES πŸ’œ

  • You can detect whether the statement produced a result set by checking the return value of the mysql_stmt_field_count(3) function. Sneaky little detective move, we love her. πŸ”

🌈 SEE ALSO 🌈


Not me ending this page with the most iconic sign-off ever: this is Version 3.4 of the MariaDB Connector/C docs, and honestly? She ate. Go buffer that result set, bestie πŸ“πŸ§šπŸ’–
πŸ“¦ where this page comes from