On Oct 30, 2008, at 3:10 PM, David Barrett wrote:

> Ok, getting close: now I test for changes in sqlite3_total_changes()  
> and
> PRAGMA schema_version and that works, except for one case:
>
>       DELETE FROM table;
>
> I see in the docs for sqlite_total_changes() that I can solve this  
> by doing:
>
>       DELETE FROM table WHERE 1;
>
> Is there any other way to detect the change without losing that
> optimization?  Thanks!

This has been changed in cvs. In version 3.6.5 sqlite3_change()
and total_changes() will correctly report the number of rows deleted
by "DELETE FROM table".

So upgrading to cvs head would work.

Dan.



> -david
>
> Igor Tandetnik wrote:
>> David Barrett <[EMAIL PROTECTED]> wrote:
>>> If so, is there any general way to determine -- given an arbitrary
>>> query -- whether or not it changed the database?
>>
>> Run PRAGMA schema_version before and after.
>>
>> Igor Tandetnik
>>
>>
>>
>> _______________________________________________
>> sqlite-users mailing list
>> [email protected]
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
> _______________________________________________
> sqlite-users mailing list
> [email protected]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to