On Fri, Oct 1, 2010 at 6:24 PM, Wolfgang Enzinger <sql...@enzinger.net>wrote:
> Am Fri, 01 Oct 2010 14:11:51 -0700 schrieb Dave Dyer: > > > There ought to be a definitive list of what errors can occur > > after sqlite3_step, and which (if any) are recoverable. > > IMHO that's impossible, at least because SQLite allows the definition of > user defined functions. Now such a function may process the first few rows > quite fine, but will raise an error with the next result row because it > encounters a NULL value where an integer is expected, for instance. > > At the time sqlite_prepare() is executed, such things cannot be foreseen. > Wolfgang is correct. An application-defined function can invoke sqlite3_result_error_code() in order to return any error it wants. So the definitive list of errors that can be returned from sqlite_step() is the universal set. We actually use that trick in testing, for example to verify that an SQLITE_SCHEMA error will only provoke a re-prepare a limited number of times before giving up and returning the error back up to the application. > > Wolfgang > > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > -- D. Richard Hipp d...@sqlite.org _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users