Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

LOAD DATA INFILE problem

Status
Not open for further replies.

bonosa

Programmer
May 19, 2004
76
US
have a txt file which I want to load into an empty table
I do

LOAD DATA INFILE 'C:/a.txt' INTO TABLE track1",

The file contains entries like
1,30.087336 ,-85.916496 ,-3.139963 ,55 ,0
2,30.087330 ,-85.916496 ,-3.140155 ,55 ,0
3,30.087324 ,-85.916496 ,-3.140346 ,55 ,0
4,30.087318 ,-85.916496 ,-3.140730 ,55 ,0

When the command executes and i look in the table I see
the first column has 1,2,3 etc, but the rest of the columns have NULL in them....
I know it is definitely reading the file to load it, but why does it only update the first column and put NULLs everywhere else?
thanks,
sb
 
You might want to consider adding :

FIELDS TERMINATED BY ',';

So it knows where to separate the fields.

Code:
LOAD DATA INFILE 'C:/a.txt' INTO TABLE track1 FIELDS TERMINATED BY ',';

----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top