On this page
sqlite3.ProgrammingError
Prev: sqlite3.PrepareProtocol | Up: sqlite3 | Next: sqlite3.register_adapter
Rel: sqlite3.adapt, sqlite3.Binary, sqlite3.Blob, sqlite3.complete_statement
Ref: docs.python.org โ sqlite3.ProgrammingError
Tags: #public #python3 #stdlib #sqlite3
Import
import sqlite3
from sqlite3 import ProgrammingError
Signature & Overview
sqlite3.ProgrammingError(...)
sqlite3.ProgrammingError class.
Methods & Attributes
ProgrammingError.add_note(self, note, /)โ Add a note to the exceptionProgrammingError.with_traceback(self, tb, /)โ Set self.traceback to tb and return self.
Usage
import sqlite3
con = sqlite3.connect(":memory:")
con.close()
try:
con.execute("SELECT 1")
except sqlite3.ProgrammingError as exc:
assert "closed" in str(exc)
Gotchas
- Raised on API misuse: Using a closed connection, passing the wrong number of
?parameters, or callingexecute()with multiple statements (useexecutescript()instead).
REPL Inspect
from sqlite3 import ProgrammingError
help(ProgrammingError)
Linked from
Related notes
- tuts/python3/stdlib_module/sqlite3 Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/sqlite3/PrepareProtocol Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/sqlite3/register_adapter Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/sqlite3/adapt Linked here; shared tags: #stdlib
- tuts/python3/stdlib_module/sqlite3/Binary Linked here; shared tags: #stdlib
- tuts/python3/stdlib_module/sqlite3/Blob Linked here; shared tags: #stdlib
- tuts/python3/stdlib_module/sqlite3/complete_statement Linked here; shared tags: #stdlib
- tuts/c/stdlib shared tags: #stdlib
- tuts/c/stdlib/assert shared tags: #stdlib
- tuts/c/stdlib/assert/assert shared tags: #stdlib