国产成人精品亚洲777人妖,欧美日韩精品一区视频,最新亚洲国产,国产乱码精品一区二区亚洲

您的位置:首頁技術文章
文章詳情頁

python mysql插入語句 返回1064

瀏覽:133日期:2022-06-28 10:32:26

問題描述

Traceback (most recent call last): File 'python_mysql.py', line 78, in <module>

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)

問題解答

回答1:

sql='insert into test1 (code) values (%s)'self.cursor.executemany(sql, code)

標簽: Python 編程
相關文章:
主站蜘蛛池模板: 滦南县| 越西县| 乐昌市| 仁寿县| 广昌县| 河西区| 衡山县| 博白县| 安义县| 连江县| 邵武市| 绥化市| 老河口市| 平乐县| 安图县| 金平| 巨野县| 长汀县| 赣州市| 于田县| 昆山市| 雅江县| 榆树市| 舞钢市| 刚察县| 南木林县| 汉寿县| 垫江县| 龙川县| 锦州市| 静安区| 汽车| 祥云县| 集安市| 伊吾县| 固始县| 措美县| 来凤县| 三河市| 钦州市| 楚雄市|