Answer the question
In order to leave comments, you need to log in
Why is the table not being created in sqlite3?
import sqlite3
from sqlite3 import Error
def sql_connection():
try:
con = sqlite3.connect('bomberdb.db')
return con
except Error:
print(Error)
def sql_table(con):
cursorObj = con.cursor()
cursorObj.execute("CREATE TABLE limit(id integer, count integer)")
limit = (360560,1)
cursorObj.execute('INSERT INTO limit(id, count) VALUES(?, ?)', limit)
con.commit()
con = sql_connection()
sql_table(con)
Traceback (most recent call last):
File "db.py", line 25, in <module>
sql_table(con)
File "db.py", line 20, in sql_table
cursorObj.execute("CREATE TABLE limit(id integer, count integer)")
sqlite3.OperationalError: near "limit": syntax error
Answer the question
In order to leave comments, you need to log in
Reserved word - correct for limits - will work
https://www.w3schools.com/sql/sql_ref_keywords.asp
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question