Issue 104: Feature Request: Row results as Dict's?
Status:  WontFix
Owner: ----
Closed:  Sep 2010
Reported by jake.e.w...@gmail.com, Jun 21, 2010
I can greatly appreciate being able to access a column's value in a row this way:

{{{print row.the_column}}}

However, in some cases its extremely useful to access the column's via a Dict like this:

{{{print row["the_column"]}}}

One basic example on how this is helpful:

{{{SELECT column1+column2 AS "My Data" FROM mytable}}}

In this case, your resulting column name is "My Data". Obvious you cannot access that column via object oriented methods like this:

{{{print row.My Data}}}

Is this something you would consider adding to pyodbc? Great module btw!

Aug 20, 2010
Project Member #1 mkleehammer
I understand the issue, but you can use this workaround in the meantime:

  getattr(row, 'My Data')

You can also use row[0], of course, which is often handy.

Is this good enough?
Status: Investigating
Sep 4, 2010
Project Member #2 mkleehammer
(No comment was entered for this change.)
Status: WontFix