0

I have a .csv file that i need to insert into database table using.Here is the query that i am using ..

LOAD DATA INFILE 'C:\Users\vikas\Desktop\UserDetails.txt' INTO employee_users  FIELDS TERMINATED BY ',' LINES TERMINATED BY ''(@UserName,@EmpID,@DepName,@MailId,@MonthlyQuota)

But i am getting error.

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'employee_users  FIELDS TERMINATED BY ',' LINES TERMINATED BY ''(@UserName,@EmpI' at line 1

Please help me to resolve this.

1 Answer 1

1

Can you try adding table before employee_users

LOAD DATA INFILE 'C:\Users\vikas\Desktop\UserDetails.txt' INTO TABLE employee_users FIELDS TERMINATED BY ',' LINES TERMINATED BY ''(@UserName,@EmpID,@DepName,@MailId,@MonthlyQuota)

Syntax Reference: LOAD DATA INFILE SYNTAX

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.