4 messages in com.mysql.lists.mysqlRe: load data infile question
FromSent OnAttachments
Stan Anderton04 Aug 1999 08:34 
Stan Anderton04 Aug 1999 08:54 
Ralph Graulich04 Aug 1999 13:34 
Deniz Demir04 Aug 1999 23:43 
Subject:Re: load data infile question
From:Stan Anderton (crea@ior.com)
Date:08/04/1999 08:54:46 AM
List:com.mysql.lists.mysql

Oops! Please disregard. I found my error. For those that wish to know, it goes like this:

mysql > load data infile '/home/mydir/Data.txt' into table Data ->fields terminated by ';' ->optionally enclosed by '"';

Oh, how stupid I feel sometimes. ;-)

Greetings!

I am having syntax difficulty with importing data into my database. I am hoping someone can point out my error.

The command:

mysql> load data infile '/home/mydir/Data.txt' into table Data ->fields terminated by ';' ->fields optionally enclosed by ";

When I give the command as above, I get another -> line instead of completion. If I use '"' I get a parse error.

What should I use. In the docs I see both of the above used in the examples. If I don't use any 'fields optionally enclosed by' at all, then my varchar fields are imported with quotes around them which messes up my queries.

Suggestions please,

Thanks in advance, Stan Anderton