-2

I am trying to load a text file with fields separated by commas and lines by a newline. The data is out of order from my table, and i am trying to pass my column names out of order. Is this the correct way to go about this?

LOAD DATA INFILE 'project_file.txt'
    INTO TABLE COURSES 
    (course_id,section_tag,course_num,section,days_taught,classroom,
     time_offered,current_teacher)
    FIELDS TERMINATED BY ','
    LINES TERMINATED BY '\n';
SteveManC
  • 132
  • 4
  • 12

1 Answers1

0

Please be sure to review the mysql manual next time before posting. Column assignment goes at the end of the query like so:

LOAD DATA INFILE 'project_file.txt'
INTO TABLE COURSES 
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n' 
(course_id,section_tag,course_num,section,days_taught,classroom,
time_offered,current_teacher);
Kirk Logan
  • 733
  • 2
  • 8
  • 23