I've looked high and low for what I hope is a trivial answer.
I was trying to load a table using LOAD DATA INFILE. Unfortunately, it craps out because there are some duplicate primary keys. Not surprising as the source did not enforce uniqueness. My problem is the load data simply dies without indicating which line of the input file was in error; the error message refers to line 3, which is not even the SQL statement for the LOAD DATA INTO statement:
I can get the table loaded by specifying REPLACE INTO TABLE, but that still leaves me with not knowing where the duplicate records are.
So... I wanted to read the data line at a time and use a plain INSERT statement. That way I could check for duplicate keys and discover where the duplicate records are. However, I can't find a way to read input from the console or a file. What am I missing? I know I could write a java or C++ program to do this, but it seems like overkill for what should be a trivial task.
Thanks for any pointers,
Gary
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/mysql
Jun 14
Keith Keller Re: console input
Jun 14, 2012; 22:35
Keith Keller
Re: console input
Jun 15
Ananda Kumar Re: console input
Jun 15, 2012; 11:36
Ananda Kumar
Re: console input
Jun 15
Johan De Meersman Re: console input
Jun 15, 2012; 08:46
Johan De Meersman
Re: console input
Jun 15
Shawn Green Re: console input
Jun 15, 2012; 08:48
Shawn Green
Re: console input
Jun 15
Gary Aitken Re: console input
Jun 15, 2012; 09:18
Gary Aitken
Re: console input
Jun 15
Keith Keller Re: console input
Jun 15, 2012; 08:21
Keith Keller
Re: console input
Search
Lasso Programming
This site manages and broadcasts several email lists pertaining to Lasso Programming and technologies related and used by Lasso developers. Sign up today!