"Aravinda babu" <[EMAIL PROTECTED]>
wrote in message
news:[EMAIL PROTECTED]
> SQLITE returning SQLITE_DONE even if record is not present.
>
> I hope that the return code will
> be
>
> SQLITE_NOTFOUND but i am getting  SQLITE_DONE ?
>
> Why is this happening ...........

This is by design. sqlite3_step returns SQLITE_ROW for each row in the 
resultset, and SQLITE_DONE to indicate there are no more rows. So if a 
resultset contains N rows, then N calls would return SQLITE_ROW and 
(N+1)st returns SQLITE_DONE. An empty resultset is not in any way 
special, it follows the same logic with N=0 (so the very first call 
returns SQLITE_DONE). This allows client code to handle all resultsets 
uniformly.

SQLITE_NOTFOUND is an obsolete error code that's currently not used for 
anything at all.

Igor Tandetnik



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

Reply via email to