Keith Herold wrote:
Well, yeah, I was hoping to get it out of  a succession of queries.
SQLite's API is hidden behind a wrapper, and most of it is masked out,
so getting access to the API is problematic.  Unfortunately, the
semantics of the return code on that API call mean that the  execute
took place, not necessarily that the execute statement succeeded (I
have no idea why), so I can't look at the return to determine if a
change occurred.

I have found change_count in func.c; when testing that using
sqlite.exe, if I do an Insert, and then write a 'changes' select, I
get 0 changes.  However, when I do the insert and select as a single
statement (that is, I hit enter only once, not twice), I get back
changes = 1, which is what I need for now.  I assume that for SQLite3,
instead of change_count, I should use 'changes'?


If you are using version 3 of sqlite you can do:

SELECT changes();

after your insert to get the number of rows changed by your insert. This function returns the number of rows modified by the previous INSERT, UPDATE, or DELETE statement.

If you are using version 2.8.15 there is an experimental fucntion that provides the same information, last_statement_change_count().




Reply via email to