You are not logged in.
Are there have an easy way to update one record ?
select * from tablename where keyfield=?keyValue
if found
update
else
insert JSON
Offline
See TSQLRest.AddOrUpdate if keyfield is ID.
https://synopse.info/files/html/api-1.1 … DDORUPDATE
But it will depend on the supplied ID value (0 or not 0).
Otherwise, there is no such a direct method, since a command like REPLACE is not supported directly by all SQL dialects.
You should rather use an aggregate record, and update internal fields depending on your business logic.
Offline
@ab, is there a way for us to extend the TSQLRestBatch class to support the real "INSERT OR REPLACE" operation supported by SQLITE? Thanks.
Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.
Offline
In my old project, I got tableName and delta (in TFDMemTable & TClientDataset, What Log changs), It can easy save to Datasnap's Server.
If I serializate tableName and delta to Json,
How I save the Json to mORMot's server?
Offline