Oracle 5.0 Reference Manual page 2216

Table of Contents

Advertisement

MYSQL_TYPE_BLOB
character set. That is, it is treated as a byte string and no conversion occurs.
The following table shows the permissible values for the
structures for output values received from the server. The table shows the SQL types of received
values, the corresponding type codes that such values have in result set metadata, and the
recommended C language data types to bind to the
without conversion. Choose the
variable that you are binding. For the integer types, you should also set the
indicate whether the variable is signed or unsigned.
SQL Type of Received
Value
TINYINT
SMALLINT
MEDIUMINT
INT
BIGINT
FLOAT
DOUBLE
DECIMAL
YEAR
TIME
DATE
DATETIME
TIMESTAMP
CHAR,
BINARY
VARCHAR,
VARBINARY
TINYBLOB,
BLOB,
TEXT
MEDIUMBLOB,
LONGBLOB,
BIT
20.6.8.2. C API Prepared Statement Type Conversions
Prepared statements transmit data between the client and server using C language variables on the
client side that correspond to SQL values on the server side. If there is a mismatch between the C
variable type on the client side and the corresponding SQL value type on the server side, MySQL
performs implicit type conversions in both directions.
MySQL knows the type code for the SQL value on the server side. The
MYSQL_BIND
side. The two codes together tell MySQL what conversion must be performed, if any. Here are some
examples:
• If you use
be stored into a
• If you fetch an SQL
MYSQL_TYPE_LONGLONG
C API Prepared Statement Data Structures
indicates binary input string data. The value is treated as having the
buffer_type
buffer_type
MYSQL_TYPE_TINY
MYSQL_TYPE_SHORT
MYSQL_TYPE_INT24
MYSQL_TYPE_LONG
MYSQL_TYPE_LONGLONG
MYSQL_TYPE_FLOAT
MYSQL_TYPE_DOUBLE
MYSQL_TYPE_NEWDECIMAL
MYSQL_TYPE_SHORT
MYSQL_TYPE_TIME
MYSQL_TYPE_DATE
MYSQL_TYPE_DATETIME
MYSQL_TYPE_TIMESTAMP
MYSQL_TYPE_STRING
MYSQL_TYPE_VAR_STRING
TINYTEXT
MYSQL_TYPE_TINY_BLOB
MYSQL_TYPE_BLOB
MEDIUMTEXT
MYSQL_TYPE_MEDIUM_BLOB
LONGTEXT
MYSQL_TYPE_LONG_BLOB
MYSQL_TYPE_BIT
structure indicates the type code of the C variable that holds the value on the client
with an
MYSQL_TYPE_LONG
column, MySQL converts the value to floating-point format before storing it.
FLOAT
MEDIUMINT
and use a C variable of type
buffer_type
MYSQL_BIND
value according to the data type of the C language
Value
variable to pass an integer value to the server that is to
int
column value, but specify a
2196
member of
structure to receive the SQL values
is_unsigned
Output Variable C Type
signed char
short int
int
int
long long int
float
double
char[]
short int
MYSQL_TIME
MYSQL_TIME
MYSQL_TIME
MYSQL_TIME
char[]
char[]
char[]
char[]
char[]
char[]
char[]
buffer_type
value of
buffer_type
as the destination buffer,
long long int
binary
MYSQL_BIND
member to
value in the

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents