I’m getting the sqlite3.OperationalError: no such colum: bla error.
I have a sqlite file, which only consists of one table foo with column bar.
connection = lite.connect(db.sqlite)
def insertEvent(self, bar):
with connection:
cur = connection.cursor()
cur.execute("INSERT INTO foo(bar) VALUES (bar);")
insertEvent("bla")
Is my syntax wrong or why am I getting the error? I couldn’t find any useful solutions in all the other questions.
Just in case: I’m using the sqlite3 library.
Try changing the insert statement to
You aren’t using the
barparameter in the insert statement.