#1 2016-11-22 16:47:44

edwinsn
Member
Registered: 2010-07-02
Posts: 1,215

How to obtain the "affected row count" of a call to TSQLRest.Execute?

Sometimes after executing a DELETE/UPDATE statement, we need to examine the affected row count and I remember the SQLITE engine itself provides this feature. How to get that info out of TSQLRest? Thanks.


Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.

Offline

#2 2016-11-22 16:59:29

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,238
Website

Re: How to obtain the "affected row count" of a call to TSQLRest.Execute?

It is not possible, since it is not desired.
You should not use TSQLRest.Execute() from a client.
It is unsafe, and is to be disabled on any serious production system.

Write a persistence service instead, and call you custom SQL on the server side.
Using SynSQLite3, you are able to call TSQLDataBase.LastChangeCount.
Using SynDB, use ISQLDBStatement.UpdateCount.

Offline

#3 2016-11-23 05:44:08

edwinsn
Member
Registered: 2010-07-02
Posts: 1,215

Re: How to obtain the "affected row count" of a call to TSQLRest.Execute?

Actually I'm talking about the server side smile

I see now, access TSQLRestServerDB.DB.LastChangeCount.

Thanks!


Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.

Offline

Board footer

Powered by FluxBB