Hallo Thorsten,

Op 14 Sep 05 schreef Thorsten Moeller aan MySQL Mailinglist:

 TM> i am trying to load a csv file with "LOAD DATA INFILE". This File
 TM> contains columns with decimal values with the german comma instead of
 TM> the dot as separator (e.g. 3.20 is 3,20). Is there an option to handle
 TM> this during or immediately before LOAD with MySQL Commands/Tools. Now we
 TM> only see values where the values on the right of the comma have been cut
 TM> off.

I asked this same question on June 22, and got the following answer:

  What about reading the data into the table and storing the 'amount'
  in varchar for now. Then you can run an update query in which you
  replace the decimal comma with a decimal point and store that in the
  float field (emptying the varchar in the process).

  UPDATE `table` SET `amount`= REPLACE( `v_amount`, ',' , '.'),
  `v_amount` = NULL WHERE `v_amount` IS NOT NULL;

Groetjes,

           Hans.

jdh punt beekhuizen bij duinheks punt xs4all punt nl

--- GoldED+/LNX 1.1.5/050823
 * Origin: The Wizard is using MBSE/Linux (2:280/1018)

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to