Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update problem with replace into

Status
Not open for further replies.

Baukep

Programmer
Sep 28, 2006
44
NL
Hello,

I'm using this query:
LOAD DATA INFILE 'D:/Effectenbeheer/Koersen/Koersen_update.vsn'
REPLACE INTO TABLE allekoersen_2006el
FIELDS TERMINATED BY ';' OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\r\n'
(tickerVL,valuta,datum,open,hoog,laag,slot,volume);

to update the table allekoersen_2006el

Runs perfectly but now I see that are there double records with only the id (autoincrement) different and that is not what I want. The older record should be updated and that is what I think 'replace into' should do.

I must be making a mistake but I cannot find it.

Any ideas?

Thanks in advance!

Bauke
 
Does your table have a primary key or unique index?

"Note that unless the table has a PRIMARY KEY or UNIQUE index, using a REPLACE statement makes no sense. It becomes equivalent to INSERT, because there is no index to be used to determine whether a new row duplicates another."


Other than that, I can't think of why you'd be having this problem.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top