I am getting a syntax error message with my Load infile command?
mysql>You have an error in your SQL syntax near 'FIELDS TERMINATED BY ',' ENCLOSED BY
> '"' at line 1
I have tried this with double quotes; TERMINATED BY "," ENCLOSED BY """
have tried this with escaping the double quotes; TERMINATED BY "," ENCLOSED BY "\""
I end each line of data with /n and when I add the LINES TERMINATED BY "\n" it says
command not found?
Load Data LOCAL Infile "data.txt" into table TableName
TERMINATED by ',' ENCLOSED BY '"' LINES TERMINATED BY '\n';
Douglas Brantz wrote:
> I am going to experiment with the input file function of Mysql tomorrow
> I have spent an hour editing a 650 line excel file and saved it as tab
> Then in word I converted the tabs to "," .
> In some fields I have commas inside the quotes and I assume that this
> will not mess things up?
> Some fields are empty so I include them with ,"",
> I don't have the \n ,which I will use to terminate the lines, in quotes
> - is that correct?
> Here is a sample :
> Address,"City",NC,Zipcode,Phone,"",Teacher, NC 28098\n
> Address,City,NC,Zipcode,"Phone",",Senior Military Assistant, US
> Here is how I plan to insert this data - please let me know if this is
> Load Data Infile "data.txt" into table TableName
> TERMINATED by ',' ENCLOSED BY '"' LINES TERMINATED BY '\n';
> Thanks in advance,
> Appalachian State University
> Boone, NC 28607
> Please check "http://www.mysql.com/php/manual.php" before
> posting. To request this thread, e-mail mysql-thread50133@stripped
> To unsubscribe, send a message to:
> If you have a broken mail client that cannot send a message to the above
> address(Microsoft Outlook), you can use http://lists.mysql.com/php/unsubscribe.php
Fine & Applied Arts
Appalachian State University
Boone, NC 28608