On Thursday, Oct 10, 2002, at 02:26 America/Phoenix, Nasir Aziz Gill  
wrote:

> Hi fellows,
>
> I got one text file of 9816 records (9816 lines) seprated by commas and
> enclosed by the inverted quotes and seprated by the end of lines. But  
> when I
> import the file, it only gets half of records in the table using below
> mentioned command;
>
> LOAD DATA INFILE 'user.txt' INTO TABLE userdata
>                               FIELDS TERMINATED BY ',' ENCLOSED BY '"'
>                               LINES TERMINATED BY '\n'
>                                       (category, fname, lname, adresse, zip, city, 
>telephone, email,
> homepage);
>
>
> I get the below mentoned message;
>
>>> Query OK, 4908 rows affected (0.91 sec)
>>> Records: 4908  Deleted: 0  Skipped: 0  Warnings: 4913
>
>
> Few records are as follow from the text file;
>
> "1","Peter","John","512 Rennes
> Road","19810","Wilmington","","mailto:[EMAIL PROTECTED]","http:// 
> www.mobili
> nk.com"
> "1","Sandra","Bridget","12th Aveneue No.  
> 301","12548","Broklyn","(212)780
> 101 10","mailto:[EMAIL PROTECTED]","";
>
> Note:    "" fields are empty(missing data) i.e.(in some records, one is
> missing faxnumber and in some records one is missing homepage and in  
> some
> one is missing telephone as well. That's why I have to use the empty  
> quotes
> for representing that field.
>
> The table structure is as follow;
>
> CREATE TABLE userdata (
>   accno int(10) unsigned NOT NULL auto_increment,
>   category mediumint(6) unsigned zerofill NOT NULL default '0',
>   fname varchar(128) NOT NULL default '',
>   lname varchar(128) NOT NULL default '',
>   add(128) NOT NULL default '',
>   zip varchar(6) NOT NULL default '',
>   city varchar(64) NOT NULL default '',
>   telefone varchar(16) NOT NULL default '',
>   homepage varchar(128) NOT NULL default '',
>   email varchar(128) NOT NULL default '',
>   telefax varchar(16) NOT NULL default '',
>   PRIMARY KEY  (accno),
>   KEY category (category),
>   KEY fname (fname),
>   KEY telefone (telefone),
>   KEY zip (zip),
>   KEY city (city),
>   KEY telefax (telefax)
> ) TYPE=MyISAM;
>
> Please advise me that whey I am not getting the whole records in the  
> table
> from the text file.
>
> Your help will be highly appreciated...
> With Best Regards...

Create a table with all the restrictions removed.  No "Key", or "NOT  
NULL" or "ENUM" or anything else.  If All the data can be loaded into  
that table then you no there is some problems with the restrictions.   
When loading data from a file, I think it best to always load data into  
an unrestricted table then move it to the final one.  It may take a  
little longer, but you can then check to see if any records were  
skipped.  Of course you may want some skipped.  Or you may find errors  
in your input file.

--
Clayburn W. Juniel, III
Phone: (602) 326-7707
Email: [EMAIL PROTECTED]
http://EffectiveSoftwareSolutions.com
--


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to