Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

I have table called student_marks, i want to update the marks of student from csv file into database, how can i do that using LOAD DATA INFILE.

Expected : For all students in the database marks has to be updated,those who are not in the database marks should not be updated.

I tried this :
                LOAD DATA INFILE '" + saveFile + "'REPLACE INTO TABLE temp1 FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '\"' LINES TERMINATED BY '\n' (StudentId,StudentName,marks)";

but all the people in the csv has been added to the database,i need update the marks of students who were already in the database.

can any one helps here..

Appreciate your time.

Site Timeline