When I run the SQL query below I get the error print(db.execute("SELECT * FROM (?);"), (tableName)) sqlite3.OperationalError: near "?": syntax error
db = sqlite3.Connection(":memory:")
db.execute("CREATE TABLE Students(name);")
tableName = "Students"
var1 = "Jon"
var2 = "Steve"
var3 = "Chuckie"
db.execute("INSERT INTO Students VALUES (?), (?), (?)", (var1, var2, var3))
print(db.execute("SELECT * FROM (?);"), (tableName))
What is the correct way to pass in parameters to a SQL query?