SQLite Forum

ExecuteNonQuery returns wrong number of affected elements
Login
Hi Gunter!

First of all thanks for the quick answer:)

I have been using system.data.sqlite, version 1.0.115.0. I have just switched from 1.0.113.0 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;

1004

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

Error: near "DELETE": syntax error

sqlite>


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.

Regards,
BB