MySQL Forums
Forum List  »  Microsoft Access

Re: Import Access Tables
Posted by: Jason Kapalczynski
Date: December 18, 2009 03:58PM

I am now trying to load a csv file into my MySQL table and I am getting errors and I cant figure out why…
The data comes into the table but it is truncated…I only get every other line…..
9 fields in the table and 9 columns in the CSV file.

Any thoughts to what is going on?


In the table in MySQL: In the last field has the first attribute of line 2 tacked onto the end. So it skipas that line and then goe sto the next. So I get every other line.
First line is 9876543211
Then the second line is 9876543213
The 9876543212 is at the end of line 1

Result in the MySQL table...
| is denoting field seperators they are not in the table
9876543211 | CA | Car Accident | 234 | Merrimac | 96th Place | Car Accident | 2008-05-04 04:30:00 | 1234567891 9876543212
9876543213 | CAI | Car | Accident | 6541 | 67th | Place Weber Rd | Car Accident 2008-05-04 04:30:00 | 1234567891 9876543214


Load Data:
load data local infile 'F:/TEMP/incident_case.csv' into table coordinates_database.incident_case fields terminated by ',' enclosed by '"' lines terminated by '\n';

Error:
Row 1 was truncated; it contained more data than there were input colums.
Row 2 was truncated; it contained more data than there were input colums.
Row 3 was truncated; it contained more data than there were input colums.
Row 4 was truncated; it contained more data than there were input colums.
Etc

CSV file:
"9876543211","CA","Car Accident","234","Merrimac","96th Place","Car Accident","2008-05-04 04:30:00","1234567891"
"9876543212","CAI","Car Accident Injuries","6541","67th Place ","Weber Rd","Car Accident injuries reported","2008-05-04 04:30:00","1234567891"
"9876543213","CAI","Car Accident Injuries","32","67th Place ","Weber Rd","Car Accident injuries reported","2008-05-04 04:30:00","1234567891"
"9876543214","CA","Car Accident","54","Stordon Ln","Weber Rd","Car Accident","2008-05-04 04:30:00","1234567892"
"9876543215","CA","Car Accident","6541","McDonlad Rd","Weber Rd","Car Accident","2008-05-04 04:30:00","1234567892"
"9876543216","CA","Car Accident","10251","Adnerson Ln","Weber Rd","Car Accident","2008-05-04 04:30:00","1234567892"
"9876543217","CAI","Car Accident Injuries","15640","Rancor Ave","54th St NE","Car Accident injuries reported","2008-05-04 04:30:00","1234567892"
"9876543228","CA","Car Accident","1021","Londerfon Rd","96th Pl NE","Car Accident","2008-05-04 04:30:00","1234567893"

Options: ReplyQuote


Subject
Views
Written By
Posted
16006
December 18, 2009 01:42PM
Re: Import Access Tables
9602
December 18, 2009 03:58PM
6157
December 21, 2009 02:10AM
4525
December 21, 2009 02:16AM
3822
December 21, 2009 08:46AM
3794
December 21, 2009 09:51AM
4856
January 04, 2010 07:56AM
3632
January 20, 2010 02:16PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.