List:General Discussion« Previous MessageNext Message »
From:(Hal Date:January 31 2012 3:33pm
Subject:Re: MySQL-kind CSV; Converting Microsoft SQL database to MySQL
View as plain text  
;>>> 2012/01/31 10:52 +0100, Johan De Meersman >>>>
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. 
<<<<<<<<
I have considered playing with engine=CSV, but never have. In the version  that I have, it
says, in effect, that NULL is not supported: in new tables only NOT-NULL fields are
allowed.

The "escape" NULL (or \N) is not a good extension.

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