问题
File C:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\mysql\connector\cursor.py, line 1149, in execute elif len(self._prepared[parameters]) != len(params): TypeError: object of type int has no len()
回答1:
The problem is python make error when we pass single parameter we need to put comma(,) at the end of first parameter. like the follwoing
input=(customerId,)
cursor.execute(sql, input)
来源:https://stackoverflow.com/questions/55762444/problem-with-python-prepared-stmt-parameter-passing