Is there a better tool than TOAD for MySql to import (csv) files into MySql?
MySql or TOAD or both are seriously mistaken!
I have a csv file that contains 2114 records (rows), I attempted to
import it into a table having identical columns, in the following
structure:
--
CREATE TABLE `lusers` (
`luser` varchar(16) NOT NULL DEFAULT '',
`lpass` varchar(16) NOT NULL DEFAULT '',
`firstname` varchar(24) NOT NULL DEFAULT '',
`surname` varchar(24) NOT NULL DEFAULT '',
`email` varchar(64) NOT NULL DEFAULT '',
`ph1` varchar(20) NOT NULL DEFAULT '',
`ph2` varchar(20) NOT NULL DEFAULT '',
`dept` varchar(50) NOT NULL DEFAULT '',
`adrs` varchar(50) NOT NULL DEFAULT '',
`city` varchar(24) NOT NULL DEFAULT '',
`country` varchar(24) NOT NULL DEFAULT '',
`descript` varchar(50) NOT NULL DEFAULT '',
`idnbr` mediumint(12) NOT NULL DEFAULT '0',
`lang` varchar(16) NOT NULL DEFAULT '',
PRIMARY KEY (`idnbr`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
--
Using TOAD I rightclick on lusers --> Send to --> Import Wizard, choose
the csv file and start the import into an empty lusers table. After many
duplicate messages, finally TOAD explains that only 48 of the 2114
records were imported, MySql disagrees with a count of 521 records
imported. In fact there are 521 records in the table, which indicates
that the import file contains 1593 duplicate values in 'idnbr',
impossible!!!!
So I create another table, like:
--
CREATE TABLE `xusers` (
`luser` varchar(16) NOT NULL DEFAULT '',
`lpass` varchar(16) NOT NULL DEFAULT '',
`firstname` varchar(24) NOT NULL DEFAULT '',
`surname` varchar(24) NOT NULL DEFAULT '',
`email` varchar(64) NOT NULL DEFAULT '',
`ph1` varchar(20) NOT NULL DEFAULT '',
`ph2` varchar(20) NOT NULL DEFAULT '',
`dept` varchar(50) NOT NULL DEFAULT '',
`adrs` varchar(50) NOT NULL DEFAULT '',
`city` varchar(24) NOT NULL DEFAULT '',
`country` varchar(24) NOT NULL DEFAULT '',
`descript` varchar(50) NOT NULL DEFAULT '',
`idnbr` mediumint(12) NOT NULL DEFAULT '0',
`lang` varchar(16) NOT NULL DEFAULT ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
ALL 2114 ARE SUCCESSFULLY IMPORTED INTO THIS ONE, as expected. Now check
to see how many duplicates are in the 'idnbr' column.
(Select distinct idnbr from xusers) results are 1997 rows returned,
which indicates that there are 117 duplicates are in the import file.
Final attempt: I exported xusers into a csv file, and then imported this
file into lusers.... still only 521 records imported, 1593 dups, but I
know there is only 117 dups in the table.
Anyone have a theory, or any suggestions? Why does the select statement
executed on xusers say that there is 1997 unique rows, when the import
says there is only 521 unique rows?
I am puzzled,
Mike
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]