Oracle 5.0 Reference Manual page 1098

Table of Contents

Advertisement

• If the
FIELDS TERMINATED BY
row (nondelimited) format is used. With fixed-row format, no delimiters are used between fields
(but you can still have a line terminator). Instead, column values are read and written using a field
width wide enough to hold all values in the field. For TINYINT, SMALLINT, MEDIUMINT, INT, and
BIGINT, the field widths are 4, 6, 8, 11, and 20, respectively, no matter what the declared display
width is.
LINES TERMINATED BY
the columns are set to their default values. If you do not have a line terminator, you should set this to
''. In this case, the text file must contain all fields for each row.
Fixed-row format also affects handling of
does not work if you are using a multi-byte character set.
Note
Before MySQL 5.0.6, fixed-row format used the display width of the column.
For example,
However, if the column contained wider values, they were dumped to their full
width, leading to the possibility of a "ragged" field holding values of different
widths. Using a field wide enough to hold all values in the field prevents this
problem. However, data files written before this change was made might
not be reloaded correctly with
up. This change also affects data files read by
by
INTO
Handling of
values varies according to the
NULL
• For the default
FIELDS
field value of
is read as
\N
• If
FIELDS ENCLOSED BY
a
value. This differs from the word
NULL
which is read as the string 'NULL'.
• If
FIELDS ESCAPED BY
• With fixed-row format (which is used when
are both empty),
NULL
empty strings in the table to be indistinguishable when written to the file because both are written as
empty strings. If you need to be able to tell the two apart when reading the file back in, you should
not use fixed-row format.
An attempt to load
NULL
for the column's data type and a warning, or an error in strict SQL mode. Implicit default values are
discussed in
Section 11.1.7, "Data Type Default
Some cases are not supported by
• Fixed-size rows
(FIELDS TERMINATED BY
columns.
TEXT
• If you specify one separator that is the same as or a prefix of another,
interpret the input properly. For example, the following
FIELDS TERMINATED BY '"' ENCLOSED BY '"'
• If
FIELDS ESCAPED BY
or
BY
LINES TERMINATED BY
to stop reading a field or line too early. This happens because
DATA INFILE
cannot properly determine where the field or line value ends.
LOAD DATA INFILE
and
FIELDS ENCLOSED BY
is still used to separate lines. If a line does not contain all fields, the rest of
NULL
was read or written using a field with a width of 4.
INT(4)
--tab, which use
mysqldump
OUTFILE.
and
values,
LINES
NULL
for input (assuming that the
NULL
is not empty, a field containing the literal word
NULL
is empty,
is written as the word NULL.
NULL
FIELDS TERMINATED BY
is written as an empty string. Note that this causes both
into a
column causes assignment of the implicit default value
NOT NULL
LOAD DATA
is empty, a field value that contains an occurrence of
followed by the
1078
Syntax
values are both empty (''), a fixed-
values, as described later. Note that fixed-size format
LOAD DATA INFILE
mysqlimport
LOAD DATA INFILE
and
options in use:
FIELDS
LINES
is written as a field value of
ESCAPED BY
enclosed within
FIELDS ENCLOSED BY
Values".
INFILE:
and
FIELDS ENCLOSED BY
clause would cause problems:
FIELDS
FIELDS TERMINATED BY
for MySQL 5.0.6 and
and written
and
SELECT ...
for output, and a
\N
character is "\").
as its value is read as
NULL
characters,
and
FIELDS ENCLOSED BY
values and
NULL
both empty) and
BLOB
LOAD DATA INFILE
FIELDS ENCLOSED
value causes
LOAD
LOAD DATA INFILE
or
cannot

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents