我使用python中的excel工作表生成查询,然后使用conn.execute(query)
执行查询
但是,有一个查询失败,因为它在一个值字符串的末尾有\
。在下面的查询中查找VALUES ("test", "ABCD\"
:
INSERT INTO S_account(Sub, AccName, AccTeam, Terr, AccOwner,
Level1, GAccount, Customer, City, State, EndCusName, AccID)
VALUES ("test", "ABCD\", "test", "test", "test", "No", "Yes",
"test", "test", "test", "asdasdas")
ON DUPLICATE KEY UPDATE
Sub = VALUES(Sub), AccName = VALUES(AccName), AccTeam = VALUES(AccTeam),
Terr = VALUES(Terr), AccOwner = VALUES(AccOwner), Level1 = VALUES(Level1),
GAccount = VALUES(GAccount), Customer = VALUES(Customer),
City = VALUES(City), State = VALUES(State), EndCusName = VALUES(EndCusName)
我试着服从命令,但没用
query = re.sub('\$', '' query)
在
INSERT
语句中指定了12列,但只包含11列的值:我认为反斜杠与此无关。您的错误消息是否确实提到反斜杠是一个问题
相关问题 更多 >
编程相关推荐