2017/11/13

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


0 件のコメント: