我正在写一个脚本,需要在db中插入值
我写了一个类似
cur.execute('''INSERT into agent_info set (didNo,agentNumber,agentOrder,agentName,agentId,agentEmail,dateOfCreation,agentStatus,) values (%s,%s,%s,%s,%s,%s,%s,%s) ''',(row[0],row[2],'1','SomeName',id_generator(),'hey',ti,'FREE'))
但是我得到了一个接近agentStatus
的错误
错误如下:
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 '(didNo,agentNumber,agentOrder,agentName,agentId,agentEmail,dateOfCreation,agentS' at line 1")
逗号太多,需要删除
set
:更正声明:
SET
只能在MySQLINSERT INTO <table> SET col1=val1, col2=val2
非标准SQL扩展中使用。你知道吗相关问题 更多 >
编程相关推荐