Hi people I'm facing a (not huge) problem with mysqlimport. The mysql version I'm using is MySQL 4.0.11a-gamma'-Max'
For updating a #29000 records table from fixed-lenght ASCII file, I'm using a php script that gets a record and executes and UPDATE for each one: pretty SLOW. SO I read carefully mysqlimport and think that is THE solution for the speed matter. BUT the fields that I don't include in the mysqlimport field list get EMPTY! Here are the details: This is the table: CREATE TABLE alfabeta ( id mediumint(5) unsigned NOT NULL default '0', nombre varchar(30) NOT NULL default '''''', presenta varchar(30) NOT NULL default '''''', precio float(7,2) unsigned NOT NULL default '0.00', precio_ponderado float(7,2) unsigned NOT NULL default '0.00', fecha_mod date NOT NULL default '0000-00-00', id_psico tinyint(1) NOT NULL default '0', anexo tinyint(1) unsigned NOT NULL default '0', pami char(1) NOT NULL default '0', id_laboratorio smallint(4) unsigned NOT NULL default '0', baja tinyint(1) unsigned NOT NULL default '0', heladera tinyint(1) unsigned NOT NULL default '0', id_troquel int(10) unsigned NOT NULL default '0', id_monodroga mediumint(6) unsigned NOT NULL default '0', id_acfa smallint(5) unsigned NOT NULL default '0', id_codbarra bigint(13) unsigned NOT NULL default '0', unidades smallint(4) unsigned NOT NULL default '0', importado tinyint(1) unsigned NOT NULL default '0', sifar char(1) NOT NULL default '''', id_tamano smallint(2) unsigned NOT NULL default '0', id_tipounid smallint(4) unsigned NOT NULL default '0', id_tipovta tinyint(1) NOT NULL default '0', id_acciofar int(2) NOT NULL default '0', PRIMARY KEY (id), KEY id_troquel (id_troquel), KEY nombre (nombre,presenta) ) TYPE=MyISAM; The mysqlimport command: mysqlimport osdata -u owner -pofthedata --debug -c id,nombre,presenta,precio,id_psico,pami,id_laboratorio,baja,heladera,id_troquel,id_codbarra,unidades,importado,sifar,id_tamano,id_tipovta -r -v -l alfabeta.csv Note: the original file alfabeta.txt have fixed-lenght fields, I use an awk script to convert to alfabeta.csv The question is that, the field precio_ponderado, for example, comes from another source, NOT from alfabeta.csv, so I load it from another .csv in another .php script. But after the execution of the mysqlimport, it gets 0.00, when, well, I expect that mysqlimport leaves it unchanged because I don't list it in the -c clause. So, is that a bug or mysqlimport is only useful for populating empty tables and for that reason emptyes the values of the columns not listed? If so, I'll must to discard that sooo elegant solution and use a .php script to make a HUGE .sql file with UPDATE's (IdontwantitIdontwantitIdontwantit!) thanks in advance Jorge Llarens ___________________________________________________________ 100mb gratis, Antivirus y Antispam Correo Yahoo!, el mejor correo web del mundo http://correo.yahoo.com.ar -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]