我正在 sqllite 中执行以下查询
idP = cur.execute('SELECT id from profs where name = ?',name)
我有一个像这样的数据库表:
| id | name |
| 1 | xxxxxx |
但我收到错误:提供的绑定(bind)数量不正确。当前语句使用 1,并且提供了 6 个。
我认为字符串“xxxxxx”被视为六个单独的字符。
最佳答案
您可以尝试将参数转换为元组:
idP = cur.execute('SELECT id from profs where name = ?',(name,))
关于python - python 提供的绑定(bind)数量不正确,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33768447/