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
>> use
>> sqlite3_changes() to determine the number of rows impacted by the last
>> executed SQL.
> 
> What do you mean, "other" error conditions? And UPDATE statement that 
> updates 0 rows is just as successful as one that updates 100 rows. It is 
> not generally remarkable that the set of rows selected by WHERE clause 
> happens to be empty. If this fact is of some special significance to 
> your application, check for it with sqlite3_changes.
> -- 
> Igor Tandetnik
> 
> 
By other errors I mean SQL error, busy .... . 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 not even exist in the DB?

-- 
View this message in context: 
http://old.nabble.com/SQLITE-return-codes-for-insert-delete-update-select-tp31597492p31597723.html
Sent from the SQLite mailing list archive at Nabble.com.

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to