3
我目前使用Python 2.7的SQLite 3數據庫API。當我去執行像這樣的查詢:?不在SQLite查詢通過Python看到
c.execute('''select ? from music where ? like "%?%"''', (attr, attr, query))
我得到以下錯誤:
sqlite3.ProgrammingError: Incorrect number of bindings supplied. The current statement uses 2, and there are 3 supplied.
我認爲%?%
是什麼把它扔了。
非常感謝。 –
沒問題。無法替換數據庫實體名稱是件壞事,但如果沒有可用的信息,引擎將無法準備和預編譯查詢。 –