List:General Discussion« Previous MessageNext Message »
From:Johan De Meersman Date:January 31 2012 9:52am
Subject:Re: Converting Microsoft SQL database to MySQL
View as plain text  
----- Original Message -----
> From: "Halász Sándor" <hsv@stripped>
> 
> noting that MySQL does not really support CSV: one can set all

Not *entirely* accurate: MySQL does include a CSV engine that you can use in the same way
you would use InnoDB or any other engine.

If you create a table a with engine=CSV and then go look at the data dictionary, you'll
find the files a.frm and a.CSV there.

You can then swap a.CSV out for a properly formatted CSV file with the same structure as
the table you've created; and if a select on the table then yields the data you were
expecting, you can just do alter table a engine=InnoDB to magically transform it into a
proper table.

The other way around works, too, btw - you can easily do "create table export engine=CSV
as select * from table" and then copy the resulting export.CSV.

Given that that functionality is there, though, it baffles me why a proper CSV
import/export mechanism has never been implemented.


-- 
Bier met grenadyn
Is als mosterd by den wyn
Sy die't drinkt, is eene kwezel
Hy die't drinkt, is ras een ezel
Thread
Converting Microsoft SQL database to MySQLJames30 Jan
  • Re: Converting Microsoft SQL database to MySQLCarl Kabbe30 Jan
    • Re: Converting Microsoft SQL database to MySQLJames30 Jan
  • Re: Converting Microsoft SQL database to MySQLhsv30 Jan
    • Re: Converting Microsoft SQL database to MySQLJohan De Meersman31 Jan
      • Re: MySQL-kind CSV; Converting Microsoft SQL database to MySQLhsv31 Jan
  • Re: Converting Microsoft SQL database to MySQLSQL Maestro Group31 Jan