Question Locked

SQL Database Select

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hi I'm new to mySQL. I have managed to use LOAD DATA INFILE to populate a table (say table 'names') with the contents of a text file (tab delimited). The file has contains three cols (e.g. id, f_name, s_name) and one record (01, John, Smith).

The Load works when I have one record in the '.txt' file, when I try a multiple record file and then perform a Select * the returned table is not aligned correctly, e.g. the contents of field 'f_name' appear in 's_name'.
Can you load a multi record file using the LOAD DATA INFILE statement? If so, how?

Thanks,
Mo

2 replies

by tony hopkinson

but, I'd suggest it's a file format problem.
For instance a tab after the s_name column.
If this is just a one off to get data in then persevere, but there were more than a few problems last time I looked with this facility.
Particularly in terms of security and replication.

This discussion is closed to new replies.