List:General Discussion« Previous MessageNext Message »
From:Amer Neely Date:May 20 2002 5:12pm
Subject:Re: query - primary key
View as plain text  
> Hi,
>   
>   Firstly, how do i correct that error of BAD text coz i actually
>   have a text file which has a HISTORY dump from IE.
>   
>   Secondly what about the Duplicate Entry stuff, its comming for
>   all the URLs why??
> 
>   Regards
>   Sameer

It's been my experience with loading data from text files that most
errors are caused by the end-of-line character/s. You may be importing
text from a file created by Windoze, and loading it into a db on Unix.
The end of line characters are different. In this case you will have to
specify what the 'termination' is: \r\n, \n, or whatever. Also check
your field delimter: is it a tab or what. If it's a tab you shouldn't
have to do anything, but if it's something else you will either have to
change your textfile, or specify what the field terminator is.

Something like this:

LOAD DATA LOCAL INFILE "yourfile.txt" INTO TABLE LevelOne FIELDS
TERMINATED BY '\t' LINES TERMINATED BY '\r\n'

This mixup will cause the duplicate key error as well I believe, since
the line pointer is not moving forward in your file.

-- 
/* All outgoing email scanned by Norton Antivirus 2002 */
Amer Neely, Softouch Information Services
W: www.softouch.on.ca
E: aneely@stripped
V: 519.438.5887
Perl | PHP | MySQL | CGI programming for shopping carts, data entry
forms.
"We make web sites work!"

Thread
query - primary keySameer Maggon20 May
  • Re: query - primary keyDan Nelson20 May
Re: query - primary keySameer Maggon20 May
  • Re: query - primary keyDan Nelson20 May
Re: query - primary keySameer Maggon20 May
Re: query - primary keyAmer Neely20 May