2017-03-16 14 views
0

入力変数をSELECTステートメントに使用しようとしていますが、エラーが発生しています。sqlite3.ProgrammingError:指定された数のバインディングが正しくありません。現在のステートメントは0を使用し、9があります。

sheetname=input("Enter the name of the SEO Analysis sheet:") 
cur=conn.execute("select * from seo_info where url like '%?%'",sheetname,) 
print(cur.fetchall()) 

File "E:/Python/SEO_Project2.py", line 40, in <module> 
cur=conn.execute("select * from seo_info where url like '%?%'",sheetname,) 
sqlite3.ProgrammingError: Incorrect number of bindings supplied. The current statement uses 0, and there are 9 supplied. 

解決するには以下のスレッドを参照しますが、それでもエラーが表示されます。 おそらく私はコードで言及するためにここに少し欠けている!私はそれをやった

sqlite3.ProgrammingError: Incorrect number of bindings supplied. The current statement uses 1, and there are 5 supplied

答えて

1

cur=conn.execute("select * from seo_info where url like (?)",['%'+sheetname+'%']) 
関連する問題

 関連する問題