C API Data Structures
2136
A boolean type, for values that are true (nonzero) or false (zero).
The
MYSQL_FIELD
structure contains the members described in the following list:
•
char * name
The name of the field, as a null-terminated string. If the field was given an alias with an
AS
clause,
the value of
name
is the alias.
•
char * org_name
The name of the field, as a null-terminated string. Aliases are ignored. For expressions, the value is
an empty string.
•
char * table
The name of the table containing this field, if it isn't a calculated field. For calculated fields, the
table
value is an empty string. If the column is selected from a view,
table
names the view. If the
table or view was given an alias with an
AS
clause, the value of
table
is the alias. For a
UNION
, the
value is the empty string.
•
char * org_table
The name of the table, as a null-terminated string. Aliases are ignored. If the column is selected from
a view,
org_table
names the underlying table. For a
UNION
, the value is the empty string.
•
char * db
The name of the database that the field comes from, as a null-terminated string. If the field is a
calculated field,
db
is an empty string. For a
UNION
, the value is the empty string.
•
char * catalog
The catalog name. This value is always
"def"
.
•
char * def
The default value of this field, as a null-terminated string. This is set only if you use
mysql_list_fields()
.
•
unsigned long length
The width of the field. This corresponds to the display length, in bytes.
The server determines the
length
value before it generates the result set, so this is the minimum
length required for a data type capable of holding the largest possible value from the result column,
without knowing in advance the actual values that will be produced by the query for the result set.
•
unsigned long max_length
The maximum width of the field for the result set (the length in bytes of the longest field value for the
rows actually in the result set). If you use
mysql_store_result()
or
mysql_list_fields()
,
this contains the maximum length for the field. If you use
mysql_use_result()
, the value of this
variable is zero.
The value of
max_length
is the length of the string representation of the values in the result set. For
example, if you retrieve a
FLOAT
column and the “widest” value is
-12.345
,
max_length
is 7 (the
length of
'-12.345'
).
If you are using prepared statements,
max_length
is not set by default because for the binary
protocol the lengths of the values depend on the types of the values in the result set. (See
Section 20.6.8, “C API Prepared Statement Data Structures”
.) If you want the
max_length
values
Содержание 5.0
Страница 1: ...MySQL 5 0 Reference Manual ...
Страница 18: ...xviii ...
Страница 60: ...40 ...
Страница 396: ...376 ...
Страница 578: ...558 ...
Страница 636: ...616 ...
Страница 844: ...824 ...
Страница 1234: ...1214 ...
Страница 1426: ...MySQL Proxy Scripting 1406 The following diagram shows an overview of the classes exposed by MySQL Proxy ...
Страница 1427: ...MySQL Proxy Scripting 1407 ...
Страница 1734: ...1714 ...
Страница 1752: ...1732 ...
Страница 1783: ...Configuring Connector ODBC 1763 ...
Страница 1793: ...Connector ODBC Examples 1773 ...
Страница 1839: ...Connector Net Installation 1819 2 You must choose the type of installation to perform ...
Страница 1842: ...Connector Net Installation 1822 5 Once the installation has been completed click Finish to exit the installer ...
Страница 1864: ...Connector Net Visual Studio Integration 1844 Figure 20 24 Debug Stepping Figure 20 25 Function Stepping 1 of 2 ...
Страница 2850: ...2830 ...
Страница 2854: ...2834 ...
Страница 2928: ...2908 ...
Страница 3000: ...2980 ...
Страница 3122: ...3102 ...
Страница 3126: ...3106 ...
Страница 3174: ...3154 ...
Страница 3232: ...3212 ...