函数序列错误(0)(SQLFetch)-SQL,Pyodbc
技术问答
291 人阅读
|
0 人回复
|
2023-09-12
|
for _item in file_list: for col in cursor.execute("select column1,column2 from tbl"): if _item[0]==col.column1: #I also tried using a different cursor,still doesn't work var1 = cursor.execute("select column2 from tbl where column1=?",_item[0]) for i in var1: var2 = i[0] try: cursor3.execute("insert into tbl(column2,column1,column3,column4) values ",(var1,_item[0],_item[1],_item(2))) cursor3.commit() except IOError as error: print error我想做的是比较列表中的值和column1.如果它们匹配,它们将来自同一行column获中获取值,然后使用column2中值增加新行,但其余值不同。
2 f2 R2 \; r V但不幸的是,当我在那里的时候python在上述操作代码中抛出错误:. K, X5 }2 N9 H. j
Error: ('HY010','[HY010] [Microsoft][ODBC Driver Manager] Function sequence error (0) (SQLFetch)')排队:
7 H7 ^3 P9 w! ^1 A( mfor columnrow in cursor.execute("select column1,column2 from tbl") $ q; t( |2 w0 u: L
解决方案: |
|
|
|
|
|