mysql_stmt_data_seek(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_data_seek ✨

okay bestie, we're in the MariaDB Connector/C manual section and today's main character is mysql_stmt_data_seek(3) β€” the lil function that lets you jump around inside a result set like you're scrolling back up in the group chat πŸ’…


πŸŽ€ Name πŸŽ€

mysql_stmt_data_seek β€” seeks to an arbitrary row in a statement result set. no cap, that's literally it. you pick a row, it goes there. ✨


πŸ¦‹ Synopsis πŸ¦‹

#include <mysql.h>

void mysql_stmt_data_seek(MYSQL_STMT * stmt,
                          my_ulonglong offset);

🌸 Description 🌸

so here's the tea β˜• β€” mysql_stmt_data_seek seeks to an arbitrary row in a statement result set. and where does that result set come from? from a previous call to mysql_stmt_store_result(3). you gotta have stored it first, bestie, otherwise there's nothing to seek around in πŸ™ˆ


πŸ’– Parameter πŸ’–

  • stmt β€” a statement handle, which was previously allocated by mysql_stmt_init(3). it's giving "you must have made this first" energy 🫢
  • offset β€” row offset. this value must between 0 and number of rows - 1. so like, 0 up to rows - 1, and nothing outside that range, okay? periodt.

⭐ Return value ⭐

Returns void. that's it, that's the whole return value. no status code, no drama, just void πŸ‘‘


🌈 Notes 🌈

  • The number of rows can be obtained with the function mysql_stmt_num_rows(3). so if you need to know your upper bound for offset, that's your girl πŸ’œ

πŸ”₯ See Also πŸ”₯


Version 3.4 of the MariaDB Connector/C manual, bestie β€” and with that, mysql_stmt_data_seek(3) is a wrap. go seek some rows, slay responsibly, and don't forget to store your result set first πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from