Hi
On Mon, 12 Jun 2006 09:59:20 +0200 Sebastian Mendel lists@sebastianmendel.de wrote:
in english: is it possible to automatically create a table from CSV file? in other words: auto detect field type by content?
IMHO it could be possible, however there could be several problems:
- what length should be char fields? text or varchar?
- detecting field type from whole file can take very long, so you need to scan only few lines and then somehow handle error when your expectation fails later
We might simply choose to import everything to text fields and then let MySQL create 'optimal' structure by SELECT * FROM `table` PROCEDURE ANALYSE (). But it tends to create ENUMs for small set of values.