update failed: found 2 records

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
khh
Posts: 37
Joined: Wed 17 Nov 2004 17:10

update failed: found 2 records

Post by khh » Wed 29 Nov 2006 03:30

I use this in SQLUpdate

REPLACE INTO abs
(pid, bid, wid, day1, day2, day3)
VALUES
(:id , :cbid, &cwid, :day1, :day2);

Id and cbid are from another table in qry.SQL.

It work if the record is new but give me an error if it is there!!!

I tried to use qry.debug.SQL directly to mysql and it runs fine!

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Wed 29 Nov 2006 10:19

This error means that editing of a single record, for example in DBGrid, causes updating more than one record in the database table. MyDAC prevents such updating. If you think that updating more than one record is correct in your case, you should set the StrictUpdate option of the MyQuery object to False.

Post Reply