;>>> 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.


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

Reply via email to