Small. Fast. Reliable.
Choose any three.

About Sitemap Documentation Download License News Developers Support

## SQLite C Interface

### Error Codes And Messages

>     int sqlite3_errcode(sqlite3 *db);
>     const char *sqlite3_errmsg(sqlite3*);
>     const void *sqlite3_errmsg16(sqlite3*);

The sqlite3_errcode() interface returns the numeric result code or extended result code for the most recent failed sqlite3_* API call associated with sqlite3 handle 'db'. If a prior API call failed but the most recent API call succeeded, the return value from sqlite3_errcode() is undefined.

The sqlite3_errmsg() and sqlite3_errmsg16() return English-language text that describes the error, as either UTF8 or UTF16 respectively. Memory to hold the error message string is managed internally. The string may be overwritten or deallocated by subsequent calls to SQLite interface functions.

Calls to many sqlite3_* functions set the error code and string returned by sqlite3_errcode(), sqlite3_errmsg(), and sqlite3_errmsg16() overwriting the previous values. Except, calls to sqlite3_errcode(), sqlite3_errmsg(), and sqlite3_errmsg16() themselves do not affect the results of future invocations. Calls to API routines that do not return an error code (example: sqlite3_data_count()) do not change the error code returned by this routine. Interfaces that are not associated with a specific database connection (examples: sqlite3_mprintf() or sqlite3_enable_shared_cache() do not change the return code.

Assuming no other intervening sqlite3_* API calls are made, the error code returned by this function is associated with the same error as the strings returned by sqlite3_errmsg() and sqlite3_errmsg16().

See also lists of Objects, Constants, and Functions.

This page last modified 2007/12/14 14:37:57 UTC