1mysql_stmt_attr_get(3)        MariaDB Connector/C       mysql_stmt_attr_get(3)
2
3
4
5   Name
6       mysql_stmt_attr_get - Gets the current value of a statement attribute
7
8   Synopsis
9              #include <mysql.h>
10
11              my_bool mysql_stmt_attr_get(MYSQL_STMT * stmt,
12                                          enum enum_stmt_attr_type,
13                                          void * attr);
14
15   Description
16       Gets  the current value of a statement attribute.  Returns zero on suc‐
17       cess, non zero on failure.
18
19   Parameter
20       • stmt  -  a  statement  handle,  which  was  previously  allocated  by
21         mysql_stmt_init(3).
22
23       • enum_stmt_attr_type - attribute.  See below.
24
25       • attr - pointer to a variable, which will contain the attribute value.
26
27   Attribute types
28       The enum_stmt_attr_type parameter has the following possible values:
29
30       Value                     Type                       Description
31       ─────────────────────────────────────────────────────────────────────────────
32       STMT_ATTR_UP‐             my_bool *                  Indicates            if
33       DATE_MAX_LENGTH                                      mysql_stmt_store_re‐
34                                                            sult(3) will update the
35                                                            max_length   value   of
36                                                            MYSQL_FIELD structures.
37       STMT_ATTR_CURSOR_TYPE     unsigned long *            Possible   values   are
38                                                            CURSOR_TYPE_READ_ONLY
39                                                            or default  value  CUR‐
40                                                            SOR_TYPE_NO_CURSOR.
41       STMT_ATTR_PREFETCH_ROWS   unsigned long *            Number  of  rows  which
42                                                            will   be   prefetched.
43                                                            The default value is 1.
44       STMT_ATTR_PRE‐            unsigned int *             Number  of   parameters
45       BIND_PARAMS                                          used      for     mari‐
46                                                            adb_stmt_execute_di‐
47                                                            rect(3)
48       STMT_ATTR_STATE           enum mysql_stmt_state *    Status    of   prepared
49                                                            statement.     Possible
50                                                            values  are  defined in
51                                                            enum  mysql_stmt_state.
52                                                            This  option  was added
53                                                            in MariaDB  Connector/C
54                                                            3.1.0
55
56   Notes
57       • Setting  the  number  of prefetched rows will work only for read only
58         cursors.
59
60   See Also
61mysql_stmt_attr_set(3)
62
63
64
65Version 3.2.2                                           mysql_stmt_attr_get(3)
Impressum