U kunt dat doen door eerst een gebruikersvariabele in te stellen en deze variabele in uw SET-component te verhogen, d.w.z.
SET @a:=0; -- initialize the line count
LOAD DATA INFILE 'c:/tools/import.csv' -- my test import
REPLACE
INTO TABLE tableName
FIELDS TERMINATED BY ',' ENCLOSED BY '\"'
LINES TERMINATED BY '\n'
IGNORE 1 LINES # first row is column headers
(fieldA,fieldB,fieldC)
SET import_date = now(),
import_file = 'import.csv',
import_line = @a:[email protected]+1; -- save the incremented line count