当前位置:   article > 正文

mysql返回1064_python mysql插入语句 返回1064

cursor.executemany 1064

Traceback (most recent call last):

File "python_mysql.py", line 78, in

x.cb_model_add()

File "python_mysql.py", line 17, in cb_model_add

self.cursor.executemany(sql, params)

File "build/bdist.linux-x86_64/egg/MySQLdb/cursors.py", line 262, in executemany

File "build/bdist.linux-x86_64/egg/MySQLdb/cursors.py", line 354, in _query

File "build/bdist.linux-x86_64/egg/MySQLdb/cursors.py", line 318, in _do_query

_mysql_exceptions.ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':code)' at line 2")

sql语句如下:

sql="insert into test1 (code) values (:code)"

params = [{'code':'xx'}]

self.cursor.executemany(sql, params)

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/盐析白兔/article/detail/508957
推荐阅读
相关标签
  

闽ICP备14008679号