mysql LOAD DATA issues

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

mysql LOAD DATA issues

Post by Luke »

I'm trying to import data from a csv file with LOAD DATA INFILE For some reason this is not working. It keeps telling me "data too long for column "state" at row 1

Code: Select all

LOAD DATA LOCAL INFILE 'MERGE.TXT'
  REPLACE
  INTO TABLE `members_categories`
  FIELDS
        TERMINATED BY ','
        ENCLOSED BY '"'
  (@killthis, company, address, address2, city, state, zip, @removeme, firstname, lastname, phone, fax, website, email, category, repphone, title, familiar, position, webemail, sortname, repid, memid, status, repfax, bc_specialty, parttime, nomail, nofax, noemail)
Here's a sample row from the import file:

Code: Select all

"","Something","1234 Somewood Drive","","China","WY","12345","Something","","","(530) 222-1111","(530)999-1234","","someemail@aol.com","Accounting","","","","","someemail@aol.com","John Eaton, CPA",2230,1877,"A","",0,4,2,No,No,No
I'm on Mysql 5.0.19-standard. The manual said something about the SET functionality not working before 5.0.3
, but I'm not using that. Any ideas? :?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Table schema?
Post Reply