mysql_stmt_attr_get — Used to get the current value of a statement attribute

my_bool mysql_stmt_attr_get(MYSQL_STMT * stmt,
                            enum enum_stmt_attr_type,
                            void * attr);

Gets the current value of a statement attribute.

Parameters

stmt

A statement handle, which was previously allocated by mysql_stmt_init().

enum_stmt_attr_type

The attribute you want to get. Possible values are:

STMT_ATTR_UPDATE_MAX_LENGTH

Indicates if mysql_stmt_store_result() will update the max_length value of MYSQL_FIELD structures.

STMT_ATTR_CURSOR_TYPE

Cursor type. Possible values are CURSOR_TYPE_READ_ONLY or default value CURSOR_TYPE_NO_CURSOR.

STMT_ATTR_PREFETCH_ROWS

Number of rows which will be prefetched. The default value is 1.

attr

Pointer to a variable, which will contain the attribute value.

Return value

Zero on success, non zero on failure.

[Note]

Setting the number of prefetched rows will work only for read only cursors.

See also

mysql_stmt_attr_set()