SQLITE_ABORT: query aborted
An operation stopped before finishing, usually by request: an sqlite3_exec() callback returned non-zero, or a ROLLBACK ended a pending read or write.
- Result code
SQLITE_ABORT- Name
4- Category
- Primary result codes
What it means
SQLITE_ABORT (4) means an operation was cut short. The SQLite documentation lists two everyday cases: the callback passed to sqlite3_exec() returned non-zero, which tells SQLite to stop; or a ROLLBACK ran on the same connection while a read or write was pending, in which case the pending statement fails with SQLITE_ABORT or the extended SQLITE_ABORT_ROLLBACK.
Common causes
- A row callback in
sqlite3_exec()returned non-zero (in some bindings, an exception thrown from the callback). - A
ROLLBACKon the connection while another statement on it was still being stepped. - A
RAISE(ABORT, ...)in a trigger, which reports as a constraint error with the trigger's message.
How to fix it
-
If you use
sqlite3_exec()with a callback, make sure it returns 0 to continue. -
Finish or reset open statements before rolling back, and don't issue
ROLLBACKfrom one part of the program while another is still reading on the same connection.
Related errors
SQLITE_ABORT_ROLLBACKstatement aborted by ROLLBACKSQLITE_INTERRUPTinterruptedSQLITE_LOCKEDdatabase table is locked
More primary result codes errors
SQLITE_ERRORSQL logic errorSQLITE_PERMaccess permission deniedSQLITE_BUSYdatabase is lockedSQLITE_NOMEMout of memorySQLITE_READONLYattempt to write a readonly databaseSQLITE_IOERRdisk I/O errorSQLITE_CORRUPTdatabase disk image is malformedSQLITE_FULLdatabase or disk is full
The code and message text are from the SQLite result and error codes documentation. Browse the full SQLite error list or search every database error.
Work on SQLite in SQLly
A native SQL client for macOS, Windows and Linux with schema-aware IntelliSense, guardrails for risky statements and clear error messages, for SQLite and the other databases you use.