Jun-23-2019, 04:39 PM
Hi,
What I've overseen initially is another mistake: you can _not_ have the column name as a variable as well. The replacement acc. to the Python DB API 2.0 is only for values. like
In case you feel you need this "flexibility" on queries, your database / table design is most likely "not too good" aka need improvement.
Regards, noisefloor
Quote:How can I replace the formatting?Hardcode the table name into the SQL statement.
What I've overseen initially is another mistake: you can _not_ have the column name as a variable as well. The replacement acc. to the Python DB API 2.0 is only for values. like
c.execute('DELETE FROM foo wHERE bar = ?', ('spamegg', ))
In case you feel you need this "flexibility" on queries, your database / table design is most likely "not too good" aka need improvement.
Regards, noisefloor