RE: LOAD DATA INFILE and STR_TO_DATE
thanks, that's what I feared already.. although ugly, will do it that way so far as I don't want to do any other pre-processing on the fixed CSV's I receive. moreover I just found out STR_TO_DATE isn't available in mysql 4.0 anyway.. Michael -Original Message- From: Jigal van Hemert [mailto:[EMAIL PROTECTED] I'm afraid that the syntax states that you can only use a list of column names. I think the best you can do is make an extra varchar column to hold the raw 'date' value from the csv and use an extra query to convert it into a format suitable for the gmtDate column. Regards, Jigal. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
LOAD DATA INFILE and STR_TO_DATE
Hi, using mysql 4.0.24 I'm stuck with a problem importing a CSV-file converting the date in the CSV from MM/DD/ to a mysql table.. I'm trying: LOAD DATA INFILE '/tmp/mydata.csv' INTO TABLE mytable FIELDSTERMINATED BY ','OPTIONALLY ENCLOSED BY '' (recordType, serviceType,STR_TO_DATE(gmtDate,'%m/%d/%Y'); The date in the CSV-file field #3 is in format MM/DD/ and therefore not importet correctly; Obvisouly I'm missing something on how to use functions for columns with LOAD DATA INFILE ? TIA, Michael -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]