List:General Discussion« Previous MessageNext Message »
From:hsv Date:November 14 2012 10:16am
Subject:Re: Issue regarding the import of the date from csv file to
the table in the database in mysql
View as plain text  
>>>> 2012/11/14 10:26 +0530, sagar bs >>>>
As i have the data with some 25 variables in csv file and i need to import
to mysql.
The issue is that the date format in csv file is dd/mm/yyyy and mysql takes
the date format like yyyy/mm/dd.
The  number of variables in the csv file are same in the table in database
of mysql.
Please help me out.
<<<<<<<<
Use LOAD DATA s feature of in the same SQL statement importing into a user variable and
using it with SET, using the function STR_TO_DATE:

load data ...
(..., @dait, ...) ...
SET Sins = STR_TO_DATE(@dait, '%d/%m/%Y')

. It is not important how many decimal digits match each pattern, but it cannot match
variation in the separators.

It is required that NULLs in the file take the form '\N' or 'NULL', depending on
escape-option.

Thread
Issue regarding the import of the date from csv file to the table inthe database in mysqlsagar bs14 Nov
  • Re: Issue regarding the import of the date from csv file to the tablein the database in mysqlLarry Martell14 Nov
  • Re: Issue regarding the import of the date from csv file tothe table in the database in mysqlhsv14 Nov
    • Re: Issue regarding the import of the date from csv file to the tablein the database in mysqlsagar bs14 Nov
      • Re: Issue regarding the import of the date from csv file tothe table in the database in mysqlhsv14 Nov
        • Re: Issue regarding the import of the date from csv file to the table in the database in mysqlMogens Melander14 Nov
          • Re: Issue regarding the import of the date from csv file tothe table in the database in mysqlhsv15 Nov
Re: Issue regarding the import of the date from csv file to the table in the database in mysqlMogens Melander14 Nov
  • Re: Issue regarding the import of the date from csv file to the tablein the database in mysqlsagar bs14 Nov
Re: Issue regarding the import of the date from csv file to the table in the database in mysqlMogens Melander14 Nov
Re: Issue regarding the import of the date from csv file to the table in the database in mysqlMogens Melander14 Nov
  • Re: Issue regarding the import of the date from csv file to the table in the database in mysqlMogens Melander14 Nov