I have connected to a db and have a cursor. I wish to get the column name and data type of each column.
My code is this:
for row in cursor.columns(table='my_table'):
print(row)
print(type(row))
Output is this:
('data', 'dbo', 'my_table', 'system_code', -9, 'nvarchar', 10, 20, None, None, 0, None, None, -9, None, 20, 1, 'NO', 0, 0, 0, 0, None, None, None, None, None, None, 39)
<class 'pyodbc.Row'>
I can find no documentaion on what these values represent. I can hower get the column name by running:
for row in cursor.columns(table='my_table'):
print row.column_name
So column_name
is an attribute- what are the other attribute names? Are these documented somewhere?