C API Prepared Statement Data Structures
2195
Member
Description
unsigned int hour
The hour of the day
unsigned int minute
The minute of the hour
unsigned int second
The second of the minute
my_bool neg
A boolean flag indicating whether the time is negative
unsigned long second_part
The fractional part of the second in microseconds; currently
unused
Only those parts of a
MYSQL_TIME
structure that apply to a given type of temporal value are used.
The
year
,
month
, and
day
elements are used for
DATE
,
DATETIME
, and
TIMESTAMP
values. The
hour
,
minute
, and
second
elements are used for
TIME
,
DATETIME
, and
TIMESTAMP
values. See
Section 20.6.17, “C API Prepared Statement Handling of Date and Time Values”
.
20.6.8.1. C API Prepared Statement Type Codes
The
buffer_type
member of
MYSQL_BIND
structures indicates the data type of the C language
variable bound to a statement parameter or result set column. For input,
buffer_type
indicates the
type 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.
The following table shows the permissible values for the
buffer_type
member of
MYSQL_BIND
structures for input values sent to the server. The table shows the C variable types that you can use,
the corresponding type codes, and the SQL data types for which the supplied value can be used
without conversion. Choose the
buffer_type
value according to the data type of the C language
variable that you are binding. For the integer types, you should also set the
is_unsigned
member to
indicate whether the variable is signed or unsigned.
Input Variable C Type
buffer_type
Value
SQL Type of Destination Value
signed char
MYSQL_TYPE_TINY
TINYINT
short int
MYSQL_TYPE_SHORT
SMALLINT
int
MYSQL_TYPE_LONG
INT
long long int
MYSQL_TYPE_LONGLONG
BIGINT
float
MYSQL_TYPE_FLOAT
FLOAT
double
MYSQL_TYPE_DOUBLE
DOUBLE
MYSQL_TIME
MYSQL_TYPE_TIME
TIME
MYSQL_TIME
MYSQL_TYPE_DATE
DATE
MYSQL_TIME
MYSQL_TYPE_DATETIME
DATETIME
MYSQL_TIME
MYSQL_TYPE_TIMESTAMP
TIMESTAMP
char[]
MYSQL_TYPE_STRING
TEXT
,
CHAR
,
VARCHAR
char[]
MYSQL_TYPE_BLOB
BLOB
,
BINARY
,
VARBINARY
MYSQL_TYPE_NULL
NULL
Use
MYSQL_TYPE_NULL
as indicated in the description for the
is_null
member in
Section 20.6.8, “C
API Prepared Statement Data Structures”
.
For input string data, use
MYSQL_TYPE_STRING
or
MYSQL_TYPE_BLOB
depending on whether the
value is a character (nonbinary) or binary string:
•
MYSQL_TYPE_STRING
indicates character input string data. The value is assumed to be in the
character set indicated by the
character_set_client
[441]
system variable. If the server stores
the value into a column with a different character set, it converts the value to that character set.
Summary of Contents for 5.0
Page 1: ...MySQL 5 0 Reference Manual ...
Page 18: ...xviii ...
Page 60: ...40 ...
Page 396: ...376 ...
Page 578: ...558 ...
Page 636: ...616 ...
Page 844: ...824 ...
Page 1234: ...1214 ...
Page 1427: ...MySQL Proxy Scripting 1407 ...
Page 1734: ...1714 ...
Page 1752: ...1732 ...
Page 1783: ...Configuring Connector ODBC 1763 ...
Page 1793: ...Connector ODBC Examples 1773 ...
Page 1839: ...Connector Net Installation 1819 2 You must choose the type of installation to perform ...
Page 2850: ...2830 ...
Page 2854: ...2834 ...
Page 2928: ...2908 ...
Page 3000: ...2980 ...
Page 3122: ...3102 ...
Page 3126: ...3106 ...
Page 3174: ...3154 ...
Page 3232: ...3212 ...