Oracle 5.0 Reference Manual page 2230

Table of Contents

Advertisement

MYSQL_DATA_TRUNCATED
column values were truncated when this value is returned, check the
MYSQL_BIND
controlled by calling
Errors
CR_COMMANDS_OUT_OF_SYNC
Commands were executed in an improper order.
CR_OUT_OF_MEMORY
Out of memory.
CR_SERVER_GONE_ERROR
The MySQL server has gone away.
CR_SERVER_LOST
The connection to the server was lost during the query.
CR_UNKNOWN_ERROR
An unknown error occurred.
CR_UNSUPPORTED_PARAM_TYPE
The buffer type is MYSQL_TYPE_DATE, MYSQL_TYPE_TIME, MYSQL_TYPE_DATETIME, or
MYSQL_TYPE_TIMESTAMP, but the data type is not DATE, TIME, DATETIME, or TIMESTAMP.
• All other unsupported conversion errors are returned from mysql_stmt_bind_result().
Example
The following example demonstrates how to fetch data from a table using
mysql_stmt_result_metadata(), mysql_stmt_bind_result(), and mysql_stmt_fetch().
(This example expects to retrieve the two rows inserted by the example shown in
"mysql_stmt_execute()".) The
#define STRING_SIZE 50
#define SELECT_SAMPLE "SELECT col1, col2, col3, col4 \
MYSQL_STMT
MYSQL_BIND
MYSQL_RES
MYSQL_TIME
unsigned long length[4];
int
short
int
char
my_bool
my_bool
/* Prepare a SELECT query to fetch data from test_table */
stmt = mysql_stmt_init(mysql);
if (!stmt)
{
fprintf(stderr, " mysql_stmt_init(), out of memory\n");
exit(0);
}
if (mysql_stmt_prepare(stmt, SELECT_SAMPLE, strlen(SELECT_SAMPLE)))
{
fprintf(stderr, " mysql_stmt_prepare(), SELECT failed\n");
C API Prepared Statement Function Descriptions
is returned when truncation reporting is enabled. To determine which
structures used for fetching values. Truncation reporting is enabled by default, but can be
mysql_options()
[2942]
[2942]
[2942]
[2942]
[2941]
mysql
FROM test_table"
*stmt;
bind[4];
*prepare_meta_result;
ts;
param_count, column_count, row_count;
small_data;
int_data;
str_data[STRING_SIZE];
is_null[4];
error[4];
with the
MYSQL_REPORT_DATA_TRUNCATION
[2944]
variable is assumed to be a valid connection handle.
2210
members of the
error
option.
Section 20.6.10.10,

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents