MySQL Forums
Forum List  »  Newbie

Re: Load data in file from .csv with no headers
Posted by: Peter Brawley
Date: June 01, 2022 01:22PM

> So in the case of the .csv NOT having headers, I just use the MySQL table fields?

"IGNORE ... LINES" tells MySQL to ignore that many .csv lines of text (usually, they would be column names or "headers", and/or comments). I don't understand the question "I just use the MySQL table fields?".

The column list in the Load Data command describes expected .csv columns, in left-to-right order. The number of named columns must equal the number of .csv data columns.

Named columns in the Load Data cmd beginning with '@' are read as user variables, and for each such you'll need a SET clause as described in the Load Data docs(https://dev.mysql.com/doc/refman/8.0/en/load-data.html).

Options: ReplyQuote


Subject
Written By
Posted
Re: Load data in file from .csv with no headers
June 01, 2022 01:22PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.