John_Allen
(John Allen)
January 17, 2026, 12:21pm
1
Hi,
One of my programs can perform a mass delete or updates in SQLite. I’d like to tell the user the number of rows updated or deleted. SQLite records this information and you can retrieve it with
int sqlite3_changes(sqlite3*);
However not being anything like an SQL expert, how do I get that back into Xojo.
Thanks
Jack
Greg_O
(Greg O)
January 17, 2026, 12:44pm
2
You’ll have to do a separate query for now using the same where clause. I also suggest making a feature request though.
John_Allen
(John Allen)
January 17, 2026, 3:00pm
3
Thanks.
Have created a feature request. #80702
jack
Using
SELECT changes();
Does same as
int sqlite3_changes(sqlite3*);
So you perfectly can do it without any feature request or any new feature added to Xojo.
4 Likes
Björn Eiríksson:
Using
SELECT changes();
is there the same function for postgresql ? I didn’t find one.
John_Allen
(John Allen)
January 18, 2026, 8:43am
6
Thank you, I will give that a try.
Jack
Yes there is, see:
You need to wrap your update statement in a PLPGSQL-function. I’m doing that a lot and it works great.
David_Cox
(David Cox)
January 18, 2026, 11:08am
8
Why not use the RETURNING function:
SQL = "DELETE FROM myTable WHERE myField = 'Something' RETURNING id"
You can use RETURNING with UPDATE as well.