-
Notifications
You must be signed in to change notification settings - Fork 256
mysql_send_query
Georg Richter edited this page Jul 3, 2022
·
2 revisions
mysql_send_query - sends a SQL statement without waiting for server response
#include <mysql.h>
int mysql_send_query(MYSQL * mysql,
const char *query,
unsigned long length);
Sends a statement to the server, without waiting for the Server OK packet and/or resultset.
-
mysql
- a mysql handle, which was previously allocated by mysql_init() and connected by mysql_real_connect(). -
query
- SQL statement -
length
- length of the SQL statement
- The OK and result set package need to be retrieved by mysql_read_query_result() function
-
mysql_send_query()
can be used for semi asynchronous operation. While the function itself is blocking, an event driven application can do other tasks until result set is available.
For an example how to use 'mysql_send_query()` in an event driven model, please check Jan Kneschke's article "Async MySQL Queries with C-API".
MariaDB Connector/C Reference