17.5.2 Coding rules for input data (CSV format)
-
Specify in the files one row of table data per line. Specify a line-ending code at the end of each line. Use X'0A' (LF), X'0D0A'(CRLF), or X'00' as the line-ending code.
-
If data is imported to a row store table, the maximum length of a row of input data is 512 megabytes (536,870,912 bytes). If a row exceeds 512 megabytes, a file input error will occur during execution of the adbimport command.
-
No EOF control character can be used in an input data file.
-
Use a delimiter to demarcate the field data.
-
If you use enclosing characters, specify the enclosing character and then the delimiter. Any spaces between a delimiter and an enclosing character will be treated as data. Therefore, if there is a space between a delimiter and an enclosing character, the enclosing character might result in a specification error or might be stored as part of the data.
-
To specify the enclosing character within the data, specify the enclosing character twice in succession in the data.
Example: The single quotation mark (') is used as the enclosing character and as a character in the data.
-
If data begins with a character that is identical to the enclosing character, specify the enclosing character twice in succession in the data. Then, use the enclosing character to enclose the field data.
Example: The double quotation mark (") is used as the enclosing character and data is "ABC.
If a single-byte space or tab character is inserted at the beginning of the data, there is no need to use the enclosing character to enclose the field data.
-
Everything between enclosing characters is treated as data.
-
If field data contains the delimiter character, use the enclosing character to enclose the entire field data. If you do not enclose the entire character string in the field with the enclosing character, the delimiter character in the data will be treated as a delimiter, resulting in an error such as a column count mismatch in the input data.
The following shows examples where the enclosing character is the double-quotation mark (") and the delimiter is the comma (,).
Example 1: The following example treats 1, foo,bar, and 3 as three columns of field data:
1,"foo,bar",3
Example 2: The following example treats 1, foo, bar, and 3 as four columns of field data:
1,foo,bar,3