MySQL Forums
Forum List  »  General

Unable to import CSV file
Posted by: Mikey Terracano
Date: April 29, 2015 05:37AM

Hi,

I am trying to import a (lousy) CSV file into MySQL. I use the WAMP Server interface.

The import breaks because of a foreign key constraint error. I made sure that both cells (referencer-referenced) are varchar(10), so no problem here.

Numeric foreign keys cells work Ok - '42' is also a foreign key cell, and it works.

The string ABCDABCD01 _IS_ present in the reference table, as verified by a
simple SELECT statement.

I use the following options in the import interface:

columns separated by: <semicolon>
columns enclose with: <nothing>
columns escaped with: <blank> (I tried <nothing>, i.e. empty string, but it generates an error

lines terminated with: [auto] - the default option in the WAMP interface


The WAMP interface statement has all cells inclosed in simple quotes, irrespective of them being numbers, strings, etc., so the statement looks like

INSERT INTO tablename VALUES('1','42','ABCDABCD01', ...)

Any ideas ?

Options: ReplyQuote


Subject
Written By
Posted
Unable to import CSV file
April 29, 2015 05:37AM


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.