Oracle 5.0 Reference Manual page 2212

Table of Contents

Advertisement

the statement. To specify the statement to prepare, pass the
string to mysql_stmt_prepare().
• To provide input parameters for a prepared statement, set up
them to mysql_stmt_bind_param(). To receive output column values, set up
structures and pass them to mysql_stmt_bind_result().
• The
structure is used to transfer temporal data in both directions.
MYSQL_TIME
The following discussion describes the prepared statement data types in detail. For examples that
show how to use them, see
"mysql_stmt_fetch()".
MYSQL_STMT
This structure is a handle for a prepared statement. A handle is created by calling
mysql_stmt_init(), which returns a pointer to a MYSQL_STMT. The handle is used for all
subsequent operations with the statement until you close it with mysql_stmt_close(), at which
point the handle becomes invalid.
The
structure has no members intended for application use. Applications should not try
MYSQL_STMT
to copy a
MYSQL_STMT
Multiple statement handles can be associated with a single connection. The limit on the number of
handles depends on the available system resources.
MYSQL_BIND
This structure is used both for statement input (data values sent to the server) and output (result
values returned from the server):
• For input, use
MYSQL_BIND
values to buffers for use by mysql_stmt_execute().
• For output, use
MYSQL_BIND
result set columns, for use in fetching rows with mysql_stmt_fetch().
To use a
MYSQL_BIND
For example, to declare and initialize an array of three
MYSQL_BIND bind[3];
memset(bind, 0, sizeof(bind));
The
structure contains the following members for use by application programs. For
MYSQL_BIND
several of the members, the manner of use depends on whether the structure is used for input or
output.
enum enum_field_types buffer_type
The type of the buffer. This member indicates the data type of the C language variable bound
to a statement parameter or result set column. For input,
of the variable containing the value to be sent to the server. For output, it indicates the type
of the variable into which a value received from the server should be stored. For permissible
values, see
buffer_type
void *buffer
A pointer to the buffer to be used for data transfer. This is the address of a C language variable.
For input,
buffer
parameter. When you call mysql_stmt_execute(), MySQL use the value stored in the variable
C API Prepared Statement Data Structures
Section 20.6.10.10,
structure. There is no guarantee that such a copy will be usable.
structures with
structures with
structure, zero its contents to initialize it, then set its members appropriately.
Section 20.6.8.1, "C API Prepared Statement Type
is a pointer to the variable in which you store the data value for a statement
2192
MYSQL_STMT
MYSQL_BIND
"mysql_stmt_execute()", and
mysql_stmt_bind_param()
mysql_stmt_bind_result()
MYSQL_BIND
buffer_type
pointer and the statement
structures and pass
MYSQL_BIND
Section 20.6.10.11,
to bind parameter data
to bind buffers to
structures, use this code:
indicates the type
Codes".

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents