Name

sqlite3_errmsg() — Get an error string from last failed API call

Definition

const char* sqlite3_errmsg(   sqlite3* db );
const void* sqlite3_errmsg16( sqlite3* db );
db

A database connection.

Returns

Human-readable error message, in English.

Description

This function returns the error message from the last failed sqlite3_* API call associated with this database connection. If a failed call was followed by a successful call, the results are undefined.

Most of SQLite’s built-in error messages are extremely terse and somewhat cryptic. Although the error messages are useful for logging and debugging, most applications should provide their own end-user error messages.

If SQLite is being used in a threaded environment, this function is subject to the same concerns as sqlite3_errcode().

If an API call returns SQLITE_MISUSE, it indicates an application error. In that case, the result code may or may not be available to sqlite3_errmsg().

Get Using SQLite now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.