Oracle 5.0 Reference Manual page 2239

Table of Contents

Advertisement

parameter_number
beginning with 0.
number of bytes in the buffer.
If you want to reset/forget the sent data, you can do it with mysql_stmt_reset(). See
Section 20.6.10.21,
Return Values
Zero if the data is sent successfully to server. Nonzero if an error occurred.
Errors
CR_INVALID_BUFFER_USE
The parameter does not have a string or binary type.
CR_COMMANDS_OUT_OF_SYNC
Commands were executed in an improper order.
CR_SERVER_GONE_ERROR
The MySQL server has gone away.
CR_OUT_OF_MEMORY
Out of memory.
CR_UNKNOWN_ERROR
An unknown error occurred.
Example
The following example demonstrates how to send the data for a
data value
'MySQL - The most popular Open Source database'
column. The
#define INSERT_QUERY "INSERT INTO \
MYSQL_BIND bind[1];
long
length;
stmt = mysql_stmt_init(mysql);
if (!stmt)
{
fprintf(stderr, " mysql_stmt_init(), out of memory\n");
exit(0);
}
if (mysql_stmt_prepare(stmt, INSERT_QUERY, strlen(INSERT_QUERY)))
{
fprintf(stderr, "\n mysql_stmt_prepare(), INSERT failed");
fprintf(stderr, "\n %s", mysql_stmt_error(stmt));
exit(0);
}
memset(bind, 0, sizeof(bind));
bind[0].buffer_type= MYSQL_TYPE_STRING;
C API Prepared Statement Function Descriptions
indicates which parameter to associate the data with. Parameters are numbered
is a pointer to a buffer containing data to be sent, and
data
Note
The next
mysql_stmt_execute()
parameters that have been used with
since last
mysql_stmt_execute()
"mysql_stmt_reset()".
[2944]
[2942]
[2942]
[2942]
[2941]
variable is assumed to be a valid connection handle.
mysql
test_long_data(text_column) VALUES(?)"
call ignores the bind buffer for all
mysql_stmt_send_long_data()
or mysql_stmt_reset().
TEXT
2219
indicates the
length
column in chunks. It inserts the
into the
text_column

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents