Forum: Building VoltDB Applications

Post: How to evaluate the effect of an update or delete statement?

How to evaluate the effect of an update or delete statement?
karlh
Feb 8, 2012
Are there any helpful functions to tell you how many rows were affected by an update or delete command or is there a different or suggested way of doing this in VoltDB?
The return value should tell you
nshi
Feb 8, 2012
Hello Karlh,

The ClientResponse object returned by the procedure call should tell you how many rows were affected by updates or deletes. You can call getResults() on the response object to get the result table, then call VoltTable.asScalarLong() on the first table in that array to get the number of rows affected as a long.
Thanks, Just to clarify, so
karlh
Feb 8, 2012
Thanks,

Just to clarify, so are you saying that when you perform an update or delete, the rows you updated or deleted are returned in the results, just the same as a select query?
Hi Karl, All DML statements
aweisberg
Feb 8, 2012
Hi Karl,

All DML statements return a single row single column table containing a long that is the number of tuples modified. The actual tuples aren't returned.

-Ariel
Great, thanks Ariel.
karlh
Feb 9, 2012
Great,

thanks Ariel.