Oracle 5.0 Reference Manual page 2222

Table of Contents

Advertisement

Return Values
Zero if successful. Nonzero if
Errors
None.
Example
The following example opens a cursor for a prepared statement and sets the number of rows to fetch at
a time to 5:
MYSQL_STMT *stmt;
int rc;
unsigned long type;
unsigned long prefetch_rows = 5;
stmt = mysql_stmt_init(mysql);
type = (unsigned long) CURSOR_TYPE_READ_ONLY;
rc = mysql_stmt_attr_set(stmt, STMT_ATTR_CURSOR_TYPE, (void*) &type);
/* ... check return value ... */
rc = mysql_stmt_attr_set(stmt, STMT_ATTR_PREFETCH_ROWS,
/* ... check return value ... */
20.6.10.4.
mysql_stmt_bind_param()
my_bool mysql_stmt_bind_param(MYSQL_STMT *stmt, MYSQL_BIND *bind)
Description
mysql_stmt_bind_param()
statement that was passed to mysql_stmt_prepare(). It uses
data.
bind
contain one element for each
Suppose that you prepare the following statement:
INSERT INTO mytbl VALUES(?,?,?)
When you bind the parameters, the array of
can be declared like this:
MYSQL_BIND bind[3];
Section 20.6.8, "C API Prepared Statement Data
MYSQL_BIND
Return Values
Zero if the bind operation was successful. Nonzero if an error occurred.
Errors
CR_UNSUPPORTED_PARAM_TYPE
The conversion is not supported. Possibly the
supported types.
CR_OUT_OF_MEMORY
Out of memory.
CR_UNKNOWN_ERROR
An unknown error occurred.
C API Prepared Statement Function Descriptions
option
(void*) &prefetch_rows);
is used to bind input data for the parameter markers in the SQL
is the address of an array of
parameter marker that is present in the query.
?
element and how they should be set to provide input values.
[2942]
[2941]
is unknown.
structures. The client library expects the array to
MYSQL_BIND
structures must contain three elements, and
MYSQL_BIND
Structures", describes the members of each
[2944]
buffer_type
2202
structures to supply the
MYSQL_BIND
value is illegal or is not one of the

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents