Answer the question
In order to leave comments, you need to log in
Why am I getting "sqlite3.OperationalError: no such column: test" error?
There is a table
cursor_voice.execute("""CREATE TABLE IF NOT EXISTS voice_data(
c_name TEXT,
c_id INT,
v_name TEXT,
v_id INT
)""")
cursor_voice.execute("UPDATE voice_data SET c_name = {}".format(name_category))
cursor_voice.execute("UPDATE voice_data SET c_id = {}".format(category_private.id))
cursor_voice.execute("UPDATE voice_data SET v_name = {}".format(voice_private))
cursor_voice.execute("UPDATE voice_data SET v_id = {}".format(voice_private.id))
voice.commit()
cursor_voice.execute("UPDATE voice_data SET c_name = {}".format(name_category))
sqlite3.OperationalError: no such column: test
Answer the question
In order to leave comments, you need to log in
Queries with parameters in SQLite
Try this:
cursor_voice.execute("UPDATE voice_data SET c_name=?",(name_category,))
Only I do not understand the meaning of this request.
Because it is not necessary to substitute values in the sql query using string formatting.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question