cnxn = pyodbc.connect(…)
cursor = cnxn.cursor()
cursor.execute(…)
cursor.fetchone() cursor.fetchall() cursor.fetchmany(…)
cursor.description
sql是一种过程化语言,也就是说,他不会给你保存你的结果/微笑
cursor用完了就直接给你清零了
cursor = cursor.execute('select count(*) from crm.r_dim_cust_cars')
print(cursor.fetchone())
>>>(525794, )
print(cursor.fetchone())
>>>None