Skip to content

Unsure how to retrieve results from pyodbc.Cursor.statistics() #1107

Closed Answered by gordthompson
tcdejong asked this question in Q&A
Discussion options

You must be logged in to vote

Just call .fetchall():

>>> crsr.execute("CREATE TABLE foo (id int primary key, txt nvarchar(50))")
<pyodbc.Cursor object at 0x0000001498FCBD30>
>>> st = crsr.statistics("foo")
>>> st
<pyodbc.Cursor object at 0x0000001498FCBD30>
>>> st.fetchall()
[('test', 'dbo', 'foo', None, None, None, 0, None, None, None, 0, 0, None), ('test', 'dbo', 'foo', 0, 'foo', 'PK__foo__3213E83F52719F64', 1, 1, 'id', 'A', 0, 0, None)]

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by gordthompson
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1105 on October 24, 2022 13:12.