I have managed to create a table called drivers however I am unable to load a csv file called drivers.csv into this table
Error:
File "/workspaces/87976355/project/app.py", line 17, in <module>
db.execute("INSERT INTO drivers (driverId, driverRef, number, code, forename, surname, dob, nationality, url) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)", row.split(","))
RuntimeError: more placeholders (?, ?, ?, ?, ?, ?, ?, ?, ?) than values ('driverId', 'driverRef', 'number', 'code', 'forename', 'surname', 'dob', 'nationality', 'url
')
I've also tried to do:
db.execute("INSERT INTO drivers (driverId, driverRef, number, code, forename, surname, dob, nationality, url) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)", driverId, driverRef, number, code, forename, surname, dob, nationality, url)
But no luck which I believe python is reading driverid, driverref etc. as variables rather than name of the columns in table - drivers.
Would anyone know why I am encountering this?
CREATE TABLEandINSERTstatements. - BdR