On 10/14/06, Gunnar Roth <[EMAIL PROTECTED]> wrote:
Am 14.10.2006 um 04:40 schrieb Jay Sprenkle: > > The problem is that the function: less_goofy_sqlite3_step(); does > not exist in version 3.1.14. > Nor does the function: sqlite3_extended_result_codes() ; > Mybe you should clean your glasses ;-) the less_goofy_sqlite3_step() function is printed in the doc right in the sqlite3_step() topic. and there is this sentence: In an effort to address this, newer versions of SQLite (version 3.3.8 and later) include support for additional result codes that provide more detailed information about errors. The extended result codes are enabled (or disabled) for each database connection using the sqlite3_extended_result_codes() API. please notice the version 3.3.8 or later statement.
I didn't read the entire content of the documentation. I looked only at the appropriate sections for the question I had. I see nothing in the following section, or the section that lead me to it, that indicates what versions it applies to: "Goofy Interface Alert: The sqlite3_step() API always returns a generic error code, SQLITE_ERROR, following any error other than SQLITE_BUSY and SQLITE_MISUSE. You must call sqlite3_reset() (or sqlite3_finalize()) in order to find the specific error code that better describes the error. We admit that this is a goofy design. Sqlite3_step() would be much easier to use if it returned the specific error code directly. But we cannot change that now without breaking backwards compatibility. Note that there is never any harm in calling sqlite3_reset() after getting back an SQLITE_ERROR from sqlite3_step(). Any API that can be used after an sqlite3_step() can also be used after sqlite3_reset(). You may want to create a simple wrapper around sqlite3_step() to make this easier. For example: int less_goofy_sqlite3_step(sqlite3_stmt *pStatement){ int rc; rc = sqlite3_step(pStatement); if( rc==SQLITE_ERROR ){ rc = sqlite3_reset(pStatement); } return rc; } Simply substitute the less_goofy_sqlite3_step() call above for the normal sqlite3_step() everywhere in your code, and you will always get back the specific error code rather than a generic SQLITE_ERROR error code. " I didn't think my request unreasonable or a lot of extra effort. ----------------------------------------------------------------------------- To unsubscribe, send email to [EMAIL PROTECTED] -----------------------------------------------------------------------------