UCE Docs / sqlite_error

Signature

String sqlite_error(SQLite* db)

Parameters

db : pointer to an SQLite connection
return value : latest connector/SQLite status message

Returns the latest SQLite connector status or error message.

Successful calls usually set the message to ok or connected. Failed prepare, bind, step, pragma, or open operations include connector context plus SQLite's own error text.

Example

SQLite* db = sqlite_connect("/tmp/doc-sqlite-error.db");
sqlite_query(db, "select * from no_such_table");
print(sqlite_error(db) != "" ? "error reported" : "no error", "\n");
sqlite_disconnect(db);
Output
error reported