1mysql_send_query(3) MariaDB Connector/C mysql_send_query(3)
2
3
4
5 Name
6 mysql_send_query - sends a SQL statement without waiting for server re‐
7 ponse
8
9 Synopsis
10 #include <mysql.h>
11
12 int mysql_send_query(MYSQL * mysql,
13 const char *query,
14 unsigned long length);
15
16 Description
17 Sends a statement to the server, without waiting for the Server OK
18 packet and/or resultset.
19
20 Parameters
21 • mysql - a mysql handle, which was previously allocated by
22 mysql_init(3) and connected by mysql_real_connect(3).
23
24 • query - SQL statement
25
26 • length - length of the SQL statement
27
28 Notes
29 • The OK and result set package need to be retrieved by
30 mysql_read_query_result(3) function
31
32 • mysql_send_query() can be used for semi asynchronous operation.
33 While the function itself is blocking, an event driven application
34 can do other tasks until result set is available.
35
36 Example
37 For an example how to use ’mysql_send_query()` in an event driven mod‐
38 el, please check Jan Kneschke’s article “Async MySQL Queries with
39 C-API” (https://jan.kneschke.de/projects/mysql/async-mysql-queries-
40 with-c-api/).
41
42 See also
43 • <mysql_real_query>
44
45 • <mysql_read_query_result>
46
47
48
49Version 3.3.1 mysql_send_query(3)