1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

SQLite3のエラー「sqlite3.ProgrammingError: Incorrect number of bindings supplied. The current statement uses 1, and there are 34 supplied.」の解決方法

Last updated at Posted at 2020-07-11

エラー内容

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

間違ったコード

c.execute("insert into Ttehai values (?)",(tehai_db))

正しいコード

c.execute("insert into Ttehai values (?)",(tehai_db,))

原因

executeの第二引数にはタプルでないといけないので、項目が1個だけでも「,」が必要になる。

参考サイト

https://www.takasay.com/entry/2015/07/04/010000
https://techracho.bpsinc.jp/baba/2010_07_16/2130

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?