SQLite Forum

ExecuteNonQuery returns wrong number of affected elements
Hi Gunter!

First of all thanks for the quick answer:)

I have been using system.data.sqlite, version I have just switched from and with the old version it was good.

I wrote here because this forum is linked from that page.

Unfortunately I have got syntax error after the second select in your example: 

sqlite> BEGIN;

sqlite> SELECT count() FROM table1;


sqlite> SELECT count() from (DELETE FROM table1 RETURNING 1);

Error: near "DELETE": syntax error


But when I executed only the delete part without "SELECT count() from" I got back '1' 1004 times:)

It also works from DB Browser for SQLite.

Based on this I think there is no problem with sqlite, rather with the wrapper. Therefore my new task is to find the proper forum or simple debug it :)

In the meantime I have found that if I add any condition to the delete expression for example "where 1=1" I get back the proper value from ExecuteNonQuery.