Python + MySql で execute paramでテーブル名は渡せない
Python + MySql で execute paramでテーブル名は渡せないそうです
cur.execute("DELETE FROM %s WHERE (%s = %s);", ("myTable", "myKey", 10)) # NG
cur.execute("DELETE FROM %s WHERE (%s = %s);" % ("myTable", "myKey", 10)) # OK
コメント