-2
我想用python脚本来更新我的数据库。当我尝试运行脚本时,输出表示text:
或其他数据类型,在该字段的实际值之前。任何提示如何摆脱这个?Python脚本到SQL Server
for r in range(1, sheet.nrows):
EasementNumber = (unicode(sheet.cell(r, 0)))
Grantor = str(unicode(sheet.cell(r, 1)))
Book = str(unicode(sheet.cell(r,2)))
Page = str(unicode(sheet.cell(r,3)))
Day = str(unicode(sheet.cell(r,4)))
Month = str(unicode(sheet.cell(r,5)))
Year = str(unicode(sheet.cell(r,6)))
EasementType = str(sheet.cell(r,7))
Origin = str(unicode(sheet.cell(r,8)))
Descriptions = str(unicode(sheet.cell(r,9)))
ProjectName = str(unicode(sheet.cell(r,10)))
values = (EasementNumber, Grantor, Book, Page, Day, Month, Year, EasementType, Origin, Descriptions, ProjectName)
cursor.execute(query, values)
cursor.close()
cursor.commit()
没有代码,没有人可以说,为什么你看到'文本:' – Daniel
添加的代码示例。 –