#1 2017-08-14 20:20:56

fbkopp
Member
Registered: 2017-08-11
Posts: 4

SynDBRemote howto return the number of rows affected

How to return the number of rows affected from a sql command update or delete?
I would like to use method ExecuteInlined to this.
any help is appreciated

Offline

#2 2017-08-16 09:26:32

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

Re: SynDBRemote howto return the number of rows affected

Did you try to use ISQLDBStatement.UpdateCount method returned value?

Offline

#3 2017-08-16 10:29:24

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

Re: SynDBRemote howto return the number of rows affected

OK: this method always returned 0...

So I've implemented TSQLDBProxyStatement.UpdateCount as expected.
See https://synopse.info/fossil/info/c2278e8869

Offline

#4 2017-08-16 13:34:54

fbkopp
Member
Registered: 2017-08-11
Posts: 4

Re: SynDBRemote howto return the number of rows affected

Thanks, I'll check the changes.
Now it works like the example below

client := TSQLDBWinHTTPConnectionProperties.Create('127.0.0.1:8092', 'syndbremote', 'synopse', 'synopse');
updatecount := client.ExecuteInlined('update tablename set field1 = 10 where pkfield=1',[],False).Instance.UpdateCount;
// or
updatecount := client.ExecuteNoResult('update tablename set field1 = 10 where pkfield=1',[]);

Offline

Board footer

Powered by FluxBB