content_image/682030.jpg content_image/682046.jpg
<img src='content_image/682030.jpg'>

For more information about \ -escape syntax, see Section 9.1.1, “String Literals” . 

If the FIELDS ESCAPED BY  character is empty, escape-sequence interpretation does not occur. 

•For output, if the FIELDS ESCAPED BY  character is not empty, it is used to prefix the following characters on output: 

•The FIELDS ESCAPED BY  character. 

•The FIELDS [OPTIONALLY] ENCLOSED BY  character. 

•The first character of the FIELDS TERMINATED BY  and LINES TERMINATED BY  values, if the ENCLOSED BY  character is empty or unspecified. 

•ASCII 0  (what is actually written following the escape character is ASCII 0 , not a zero-valued byte). 

If the FIELDS ESCAPED BY  character is empty, no characters are escaped and NULL  is output as NULL , not \N . It is probably not a good idea to specify an empty escape character, particularly if field values in your data contain any of the characters in the list just given. 

In certain cases, field- and line-handling options interact: 

•If LINES TERMINATED BY  is an empty string and FIELDS TERMINATED BY  is nonempty, lines are also terminated with FIELDS TERMINATED BY . 

•If the FIELDS TERMINATED BY  and FIELDS ENCLOSED BY  values are both empty ( ’’ ), a fixed-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  is still used to separate lines. If a line does not contain all fields, the rest of 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 NULL  values, as described later. 

<img src='content_image/682046.jpg'>

## Note 

Fixed-size format does not work if you are using a multibyte character set. 

Handling of NULL  values varies according to the FIELDS  and LINES  options in use: 

•For the default FIELDS  and LINES  values, NULL  is written as a field value of \N  for output, and a field value of \N  is read as NULL  for input (assuming that the ESCAPED BY  character is \ ). 

•If FIELDS ENCLOSED BY  is not empty, a field containing the literal word NULL  as its value is read as a NULL  value. This differs from the word NULL  enclosed within FIELDS ENCLOSED BY  characters, which is read as the string ’NULL’ . 

