At 4:44 PM +0900 5/28/01, jamal wrote:
>Hi all,
>
>How to use MySQL LOAD DATA command to load comma separated text data
Huh? Your LOAD DATA statement below specifies |-separated data,
not comma-separated data.
>but one of the field can contains comma character as part of of the
>string context.?
>In other word, I want LOAD DATA insert string with comma characters
>inside it but without
>adding slash character ('\')to distinguish it as a field separator.
I may be missing something, but that doesn't appear to make sense.
If a comma is a field separator, then somehow you need to specify that
within-field commas are not separators, either by escaping them, or by
quoting the fields. Without using one of those mechanisms, MySQL has no
way to distinquish separator and non-separator commas.
>
>I use this command,
>
>LOAD DATA LOCAL INFILE "DATA.TXT" REPLACE INTO TABLE tbl
> FIELDS TERMINATED BY "|" IGNORE 1 LINES
>
>but when I look at the table tbl, everything is fine except
>in the field that contain comma character, comma charater is written
>as '\,' rather than just ','.
>
>What option of LOAD DATA should I use?
>
>Jamal
--
Paul DuBois, [EMAIL PROTECTED]
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php