So I have an sqlite3 database in Python where is a table to which I am trying to add 1000 strings. The problem is, when I use executemany command I get an error
sqlite3.ProgrammingError: Incorrect number of bindings supplied. The current statement uses 1, and there are 1000 supplied.
Here is my code simplified:
db = sqlite3.connect("service.db")
db.isolation_level = None
c = db.cursor()
c.execute("CREATE TABLE Places (id INTEGER PRIMARY KEY, name TEXT)")
toBeAdded = [0]*1000
i = 0
while i < 1000:
toBeAdded[i] = ("P"+str(i+1))
i += 1
c.executemany("INSERT INTO Places(name) VALUES (?)",[toBeAdded])
I have also tried different forms of that last command, but no luck. This was the only way I could find on Google to do this.