Re: [sqlite] SQLITE return codes for insert/delete/update/select

2011-05-12 Thread George Brink
On 5/11/2011 3:52 PM, cricketfan wrote: > > I dont know if it is just me but I find the return codes for SQL operation > quite confusing. I am new to SQLITE, have learnt a few things and wanted to > know if going in the correct direction, You are thinking in the wrong direction. SQLITE_DONE means t

Re: [sqlite] SQLITE return codes for insert/delete/update/select

2011-05-11 Thread Jean-Christophe Deschamps
>I agree with what you stated but it would have been more clearer if >the result of the update statement was a "RECORD NOT FOUND" return >value since it did not find any that met the query's criteria. How can >you say that the UPDATE was successful when the record you were >looking for does no

Re: [sqlite] SQLITE return codes for insert/delete/update/select

2011-05-11 Thread Stephan Beal
On Wed, May 11, 2011 at 10:27 PM, Igor Tandetnik wrote: > See also: http://en.wikipedia.org/wiki/Vacuous_truth > Thanks for that - that's a new term for me. i think the relevant bit of that article in this context is: -- Thus we say S is vacuously true; it is true, but in a way that doesn’t

Re: [sqlite] SQLITE return codes for insert/delete/update/select

2011-05-11 Thread Igor Tandetnik
On 5/11/2011 4:21 PM, cricketfan wrote: > How can you say that the UPDATE was successful when the > record you were looking for does not even exist in the DB? Your statement says: update all records that meet condition X. SQLite did exactly that. How is this not a success? A failure would be if y

Re: [sqlite] SQLITE return codes for insert/delete/update/select

2011-05-11 Thread cricketfan
Igor Tandetnik wrote: > > On 5/11/2011 3:52 PM, cricketfan wrote: >> 1. Return code for an UPDATE/DELETE query (ignoring other error >> conditions) >> will be SQLITE_DONE regardless of the fact whether UPDATE succeeded or >> failed. The only way to know whether the UPDATE succeeded or not is to

Re: [sqlite] SQLITE return codes for insert/delete/update/select

2011-05-11 Thread Igor Tandetnik
On 5/11/2011 3:52 PM, cricketfan wrote: > 1. Return code for an UPDATE/DELETE query (ignoring other error conditions) > will be SQLITE_DONE regardless of the fact whether UPDATE succeeded or > failed. The only way to know whether the UPDATE succeeded or not is to use > sqlite3_changes() to determin

[sqlite] SQLITE return codes for insert/delete/update/select

2011-05-11 Thread cricketfan
I dont know if it is just me but I find the return codes for SQL operation quite confusing. I am new to SQLITE, have learnt a few things and wanted to know if going in the correct direction, 1. Return code for an UPDATE/DELETE query (ignoring other error conditions) will be SQLITE_DONE regardless