The following steps take place when a field uses an ENCLOSED BY
clause and also uses a TERMINATED BY
clause.
Any whitespace at the beginning of the field is skipped.
The first non-whitespace character found must be the start of a string that matches the first ENCLOSED BY
delimiter. If it is not, then the row is rejected.
If the first ENCLOSED BY
delimiter is found, then the search for the second ENCLOSED BY
delimiter begins.
If two of the second ENCLOSED BY
delimiters are found adjacent to each other, then they are interpreted as a single occurrence of the delimiter and included as part of the data for the field. The search then continues for the second instance of the ENCLOSED BY
delimiter.
If the end of the record is found before the second ENCLOSED BY
delimiter is found, then the row is rejected.
If the second ENCLOSED BY
delimiter is found, then the parser looks for the TERMINATED BY
delimiter. If the TERMINATED BY
delimiter is anything other than WHITESPACE
, then whitespace found between the end of the second ENCLOSED BY
delimiter and the TERMINATED BY
delimiter is skipped over.
The row is not rejected if the end of the record is found before the TERMINATED BY
delimiter is found.