My favorites | Sign in
Project Home Downloads Wiki
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 230: Let various cursor methods return a namedtuple
1 person starred this issue and may be notified of changes. Back to list
Status:  NoFix
Owner:  ----
Closed:  Jan 2012


 
Reported by pmav99@gmail.com, Jan 13, 2012
An enhancement request. 

I don't know if something like that is even possible, but I think that it would be quite helpful if various cursor methods like columns, tables etc, returned a namedtuple.

with regards,
Panos

Jan 17, 2012
Project Member #1 mkleehammer
The ones you mentioned return Row objects, so you can already use names.  Look at the Cursor.columns example (https://code.google.com/p/pyodbc/wiki/Cursor)

# columns in table x
for row in cursor.columns(table='x'):
    print row.column_name

The results are the same as if you performed a SQL SELECT for the given columns.
Status: NoFix
Jan 17, 2012
#2 pmav99@gmail.com
Ah! Marvelous! Thank you!

Powered by Google Project Hosting