Replace from a file Syntax
Posted: Fri May 14, 2004 5:37 pm
I'm trying to use the replace function to do exactly what is described in the manual. The twist is that I want to replace the rows with data that is in a text file. The manual seems only to indicate how to replace one row at a time:
I need to replace 12,000 lines. I tried using the following syntax:
But that didn't replace anything. It just created duplicate rows. I DO have unique indexes defined (three of them actually) for the table in question.
Is there some other way I can insert the values found in my text file into the first REPLACE expression? Somewhere after VALUES maybe?
Code: Select all
REPLACE їLOW_PRIORITY | DELAYED]
їINTO] tbl_name ї(col_name,...)]
VALUES ({expr | DEFAULT},...),(...),...Code: Select all
LOAD DATA INFILE 'E:\AHLog.txt' REPLACE INTO TABLE `items`
FIELDS TERMINATED BY ' '
LINES TERMINATED BY '\r\n'Is there some other way I can insert the values found in my text file into the first REPLACE expression? Somewhere after VALUES maybe?