I recently updated to DA9 and what used to work in an earlier version, doesn’t work anymore.
I’m using Delphi 10 Seattle with DA 9.0.95.1233 Server Edition, and the SQLite UniDac v6.2.10 provider.
I have the following table:
'CREATE TABLE IF NOT EXISTS `projectsmeta` (' +
'`key` NVARCHAR(255) NOT NULL ,' +
'`value` NTEXT NULL ,' +
'`idproject` NVARCHAR(32) NULL )';
When I change a field on the client, this is working as expected but when I call ApplyUpdates, I see the following dialog:
A problem occured while updating a record in table “projectsmeta”, record ""
No rows were affected by this update
Tracking the problem using the OnBeforeExecuteDeltaCommand, I can see that the generated SQL is the following:
UPDATE projectsmeta SET
"key"= :key,
“value”= :value,
“idproject”= :idproject
WHERE
((“key”=:OLD_key) OR (:OLD_key IS NULL AND “key” IS NULL)) AND
((“value”=:OLD_value) OR (:OLD_value IS NULL AND “value” IS NULL)) AND
((“idproject”=:OLD_idproject) OR (:OLD_idproject IS NULL AND “idproject” IS NULL))
Old version was 8.0.81.1131 and didn’t trigger any dialog in that situation.
Could you explain why this is not working anymore in DA 9 ? Is that because this table doesn’t have a primary key ?
What could I do to avoid this error ?
yes, it can be a reason.
You can set PK for this table manually in DASM. don’t forget to update datatable schema on client-side after changing it in DASM.