Wouldn't the addition of "Empty result sets will return SQLITE_DONE on the 
first call to sqlite3_step." add some clarity?

Michael D. Black
Senior Scientist
NG Information Systems
Advanced Analytics Directorate



________________________________________
From: [email protected] [[email protected]] on 
behalf of Igor Tandetnik [[email protected]]
Sent: Sunday, March 27, 2011 8:11 PM
To: [email protected]
Subject: EXT :Re: [sqlite] sqlite3_step behavior on empty set

Sam Carleton <[email protected]> wrote:
> Is my impression correct that when calling sqlite3_step() on a query
> that returns no rows, the result will be [SQLITE_DONE]?

Yes.

> If that is the case, might that be added to the documentation?

"SQLITE_DONE means that the statement has finished executing successfully."
"If the SQL statement being executed returns any data, then SQLITE_ROW is 
returned each time a new row of data is ready for processing by the caller."

The implication is that if SQL statement doesn't return any data, then 
sqlite3_step doesn't return SQLITE_ROW. Since it nevertheless finishes 
executing successfully, it returns SQLITE_DONE.
--
Igor Tandetnik

_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to