使用pymsql
?
cursor.execute("SELECT * FROM table;")
cursor.get_return_message?
答案 0 :(得分:0)
我相信至少有四种可以这种方式使用:
rows = cursor.execute("SELECT * FROM table")
print("Total # of rows: " + str(rows.rowcount))
for row in rows:
print("Looping over row #" + str(rows.rownumber))
if(rows.rowcount == rows.rownumber):
print("Yay, we're done.')
还有Cursor.connection。更多信息:
http://pymssql.org/en/latest/ref/pymssql.html
向下滚动到Cursor对象属性(文档中拼写错误的Cusor)。祝你好运!