GeoNames Home | Postal Codes | Download / Webservice | About 

GeoNames Forum
  [Search] Search   [Recent Topics] Recent Topics   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Unable to add Primary Keys to TimeZones, Admin1Codeascii and FeatureCodes.  XML
Forum Index -> General
Author Message
robnet



Joined: 28/11/2013 11:09:41
Messages: 6
Offline

When I create the tables like this :

CREATE TABLE timeZones (
CountryCode VARCHAR(2) PRIMARY KEY,
timeZoneId VARCHAR(50),
GMT_offset DECIMAL(3,1),
DST_offset DECIMAL(3,1),
rawOffset DECIMAL(3,1)
) CHARACTER SET utf8;

and then try and load the data from teh text file like this:

LOAD DATA INFILE 'timeZones.txt INTO TABLE timezones;

I get the following error:

ERROR 1062 (23000): Duplicate Entry ' ' for key 'PRIMARY'

I dont understand why I get this. If I query that table and show the top five results the CountryCode is only showing 1 letter rather than the two that you can see in the text file, it definately tab seperated from teh rest of the data in the file.

I would really appreciate some advise guys
 
Forum Index -> General
Go to:   
Powered by JForum 2.1.5 © JForum Team