Oracle 5.0 Reference Manual page 2221

Table of Contents

Advertisement

Return Values
Zero if successful. Nonzero if
Errors
None.
20.6.10.3.
mysql_stmt_attr_set()
my_bool mysql_stmt_attr_set(MYSQL_STMT *stmt, enum enum_stmt_attr_type
option, const void *arg)
Description
Can be used to affect behavior for a prepared statement. This function may be called multiple times to
set several options.
The
option
should point to a variable that is set to the desired attribute value. The variable type is as indicated
arg
in the following table.
The following table shows the possible
Option
STMT_ATTR_UPDATE_MAX_LENGTH
STMT_ATTR_CURSOR_TYPE
STMT_ATTR_PREFETCH_ROWS
If you use the
opened for the statement when you invoke mysql_stmt_execute(). If there is already an open
cursor from a previous
mysql_stmt_reset()
mysql_stmt_free_result()
If you open a cursor for a prepared statement,
because that function causes the result set to be buffered on the client side.
The
STMT_ATTR_CURSOR_TYPE
STMT_ATTR_PREFETCH_ROWS
C API Prepared Statement Function Descriptions
option
argument is the option that you want to set. The
Note
In MySQL 5.0,
mysql_stmt_attr_get()
*, for STMT_ATTR_UPDATE_MAX_LENGTH. This is corrected in
my_bool
MySQL 5.1.7.
STMT_ATTR_CURSOR_TYPE
mysql_stmt_execute()
also closes any open cursor before preparing the statement for re-execution.
closes any open cursor.
option was added in MySQL 5.0.2. The
option was added in MySQL 5.0.6.
is unknown.
values.
option
Argument Type
my_bool *
unsigned long
*
unsigned long
*
option with CURSOR_TYPE_READ_ONLY, a cursor is
call, it closes the cursor before opening a new one.
mysql_stmt_store_result()
2201
argument is the value for the option.
arg
Function
If set to 1, causes
mysql_stmt_store_result()
update the metadata
value.
>max_length
Type of cursor to open for statement
when
mysql_stmt_execute()
is invoked.
can be
*arg
CURSOR_TYPE_NO_CURSOR
(the default) or
CURSOR_TYPE_READ_ONLY.
Number of rows to fetch from server
at a time when using a cursor.
can be in the range from 1 to the
maximum value of
unsigned
The default is 1.
uses
unsigned int
is unnecessary,
to
MYSQL_FIELD-
*arg
long.
*, not

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents