Oracle 5.0 Reference Manual page 2228

Table of Contents

Advertisement

{
fprintf(stderr, " invalid affected rows by MySQL\n");
exit(0);
}
/* Specify data values for second row,
then re-execute the statement */
int_data= 1000;
strncpy(str_data, "
The most popular Open Source database",
STRING_SIZE);
str_length= strlen(str_data);
small_data= 1000;
is_null= 0;
/* Execute the INSERT statement - 2*/
if (mysql_stmt_execute(stmt))
{
fprintf(stderr, " mysql_stmt_execute, 2 failed\n");
fprintf(stderr, " %s\n", mysql_stmt_error(stmt));
exit(0);
}
/* Get the total rows affected */
affected_rows= mysql_stmt_affected_rows(stmt);
fprintf(stdout, " total affected rows(insert 2): %lu\n",
if (affected_rows != 1) /* validate affected rows */
{
fprintf(stderr, " invalid affected rows by MySQL\n");
exit(0);
}
/* Close the statement */
if (mysql_stmt_close(stmt))
{
fprintf(stderr, " failed while closing the statement\n");
fprintf(stderr, " %s\n", mysql_stmt_error(stmt));
exit(0);
}
20.6.10.11.
mysql_stmt_fetch()
int mysql_stmt_fetch(MYSQL_STMT *stmt)
Description
mysql_stmt_fetch()
exists; that is, after a call to
a result set.
mysql_stmt_fetch()
It returns the data in those buffers for all the columns in the current row set and the lengths are
returned to the
mysql_stmt_fetch().
By default, result sets are fetched unbuffered a row at a time from the server. To buffer the entire result
set on the client, call
mysql_stmt_fetch().
C API Prepared Statement Function Descriptions
/* smallint */
/* reset */
(unsigned long) affected_rows);
Note
For complete examples on the use of prepared statement functions, refer to the
file tests/mysql_client_test.c. This file can be obtained from a MySQL
source distribution or from the Bazaar source repository.
returns the next row in the result set. It can be called only while the result set
mysql_stmt_execute()
returns row data using the buffers bound by mysql_stmt_bind_result().
pointer. All columns must be bound by the application before it calls
length
mysql_stmt_store_result()
for a statement such as
after binding the data buffers and before calling
2208
that produces
SELECT

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents