Jump to content

Data file load to table - can only get one row.


Conjurer

Recommended Posts

I am totally lost on this and have been spinning my wheels all day.

I have a table. I have a data file with 1145 records. I want to load the data into the table.

 

I have tried creating a small test with just 6 records in it. It is a csv file.

 

When I try to load it into the table it says it loaded 6 records but only one is in there.

 

Any clues what I am doing wrong? :?

 

A couple things I am wondering about is whether my Primary Key or any of the other keys would goof me up. Also the data I am loading is only the first dozen fields the others are not be used.

 

I used a list of columns with comma separation to tell it which fields.

 

Here is a sample of the text file data I am trying to load:

1,Maryann,Johnson,Clinical Contact,\"Billing Solutions, Etc, Inc\",\"2850 Southwest Cedar Hills Boulevard, Pmb 64\",,,River City,OR,97501,,503-644-8931,503-646-8931,,,,,2k1D15

2,Stephanie,Olhausen,Clinical Contact,\"Paul Puziss, M.D.\",3800 SW CEDAR HILLS BLVD,,,River City,OR,97501,SUITE #250-WESTGATE PLAZA,503-646-8931,503-644-8931,503-526-8931,,,,2c2u82

3,Kenny,Goerig,Optical Director,Sunset Eye Clinic,\"1865 NW 169 Place, Suite 105\",,,River City,OR,97501,,(503) 533-8931,(503) 533-8931,,,xyz@xyz.com,www.xyz.com,2d3N57

4,Jacob,Janecek,Optometric Physician,Sunset Eye Clinic,\"1865 NW 169 Place, Suite 105\",,,River City,OR,97501,,(503) 533-8931,(503) 533-8931,,,xyz@xyz.com,www.xyz.com,2k4p84

5,Samuel,Lee,Optometric Physician,Sunset Eye Clinic,\"1865 NW 169 Place, Suite 105\",,,River City,OR,97501,,(503) 533-8931,(503) 533-8931,,,xyz@xyz.com,www.sunseteyeclinic.com,2E5z6

 

 

Here is a dump of the table:

 

# phpMyAdmin SQL Dump

# version 2.5.2

# http://www.phpmyadmin.net

#

# Host: localhost

# Generation Time: Oct 27, 2003 at 05:39 PM

# Server version: 4.0.15

# PHP Version: 4.2.3

#

# Database : `immedia_Contacts`

#

 

# --------------------------------------------------------

 

#

# Table structure for table `Marketing`

#

# Creation: Oct 27, 2003 at 04:46 PM

# Last update: Oct 27, 2003 at 04:51 PM

#

 

CREATE TABLE `Marketing` (

`Userid` int(25) NOT NULL auto_increment,

`First_Name` varchar(25) NOT NULL default \'\',

`Last_Name` varchar(25) NOT NULL default \'\',

`Title` varchar(25) NOT NULL default \'\',

`Company` varchar(40) NOT NULL default \'\',

`Address_Line_1` varchar(60) NOT NULL default \'\',

`Address_Line_2` varchar(60) NOT NULL default \'\',

`Address_Line_3` varchar(60) NOT NULL default \'\',

`City` varchar(25) NOT NULL default \'\',

`State` char(2) NOT NULL default \'\',

`Zip_Code` varchar(10) NOT NULL default \'\',

`2nd_Address` varchar(60) NOT NULL default \'\',

`Phone` varchar(25) NOT NULL default \'\',

`Fax` varchar(25) NOT NULL default \'\',

`Phone_1` varchar(25) NOT NULL default \'\',

`Phone_2` varchar(25) NOT NULL default \'\',

`Email` varchar(25) NOT NULL default \'\',

`Web_Page` varchar(25) NOT NULL default \'\',

`Confirmation_Code` varchar(25) NOT NULL default \'\',

`Prd_Imaging` set(\'Y\',\'N\') NOT NULL default \'N\',

`Prd_EMR` set(\'Y\',\'N\') NOT NULL default \'N\',

`Prd_Appt_Schd` set(\'Y\',\'N\') NOT NULL default \'N\',

`Prd_Billing` set(\'Y\',\'N\') NOT NULL default \'N\',

`Prd_AR_Finan` set(\'Y\',\'N\') NOT NULL default \'N\',

`Prd_Docuscan` set(\'Y\',\'N\') NOT NULL default \'N\',

`Demo_Will_Attnd` set(\'Y\',\'N\') NOT NULL default \'N\',

`Contact_Has_Questions` set(\'Y\',\'N\') NOT NULL default \'N\',

`Contact_Prsnl_Info` text NOT NULL,

`Username` varchar(25) NOT NULL default \'\',

`Password` varchar(255) NOT NULL default \'\',

`User_Level` enum(\'0\',\'1\',\'2\',\'3\') NOT NULL default \'0\',

`Signup_Date` datetime NOT NULL default \'0000-00-00 00:00:00\',

`Last_Login` datetime NOT NULL default \'0000-00-00 00:00:00\',

`Activated` enum(\'0\',\'1\') NOT NULL default \'0\',

PRIMARY KEY (`Userid`),

UNIQUE KEY `Email` (`Email`),

UNIQUE KEY `Username` (`Username`),

KEY `Names` (`Last_Name`,`First_Name`),

KEY `Company` (`Company`),

KEY `Confirmation_Code` (`Confirmation_Code`)

) TYPE=MyISAM COMMENT=\'Master List of Immedia Prospects\' AUTO_INCREMENT=8 ;

 

#

# Dumping data for table `Marketing`

#

 

INSERT INTO `Marketing` (`Userid`, `First_Name`, `Last_Name`, `Title`, `Company`, `Address_Line_1`, `Address_Line_2`, `Address_Line_3`, `City`, `State`, `Zip_Code`, `2nd_Address`, `Phone`, `Fax`, `Phone_1`, `Phone_2`, `Email`, `Web_Page`, `Confirmation_Code`, `Prd_Imaging`, `Prd_EMR`, `Prd_Appt_Schd`, `Prd_Billing`, `Prd_AR_Finan`, `Prd_Docuscan`, `Demo_Will_Attnd`, `Contact_Has_Questions`, `Contact_Prsnl_Info`, `Username`, `Password`, `User_Level`, `Signup_Date`, `Last_Login`, `Activated`) VALUES (7, \'Charles\', \'Mcbride\', \'\', \'\', \'12370 S.W. First Street\', \'\', \'\', \'Beaverton\', \'OR\', \'97005\', \'\', \'(503) 644-3614\', \'\', \'\', \'\', \'\', \'\', \'2s7n60r\', \'N\', \'N\', \'N\', \'N\', \'N\', \'N\', \'N\', \'N\', \'\', \'\', \'\', \'0\', \'0000-00-00 00:00:00\', \'0000-00-00 00:00:00\', \'0\');

Link to comment
Share on other sites

This is waht I got

 

LOAD DATA INFILE \'C:\\Documents and Settings\\shiva\\Desktop\\1.txt\' INTO TABLE marketing FIELDS TERMINATED BY \',\' LINES TERMINATED BY \'n\';

 

Check the data you have.........

 

Error Code : 1062

Duplicate entry \'\' for key 3

(0 ms taken)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.