Issue 282: row object acessing fields by name
Status:  NoFix
Owner: ----
Closed:  Sep 2012
Reported by alexandr...@gmail.com, Aug 14, 2012
When using "select *" the fields cannot be accesses by name in the row object. this will be a very handy feature as already is in trhe other cases.

Using sql server 2000 and 2008 express, python 2.7


Aug 16, 2012
Project Member #1 mkleehammer
There must be more to this - I use this feature daily.  The names don't actually come from the SQL statement.  They are actually requested from the results, so there is no reason for it not to work.

Can you post an example?

Status: Investigating
Aug 17, 2012
#2 alexandr...@gmail.com
Sorry when doing the example, below I saw it was a case error in fieldname.
Uses to sqlserver and delphi c++ that was not an issue before





import pyodbc

con = pyodbc.connect('DRIVER={SQL Server};SERVER=srv-sql;DATABASE=ina;UID=sa;PWD=jfk')
c = con.cursor()

print [r.column_name for r in c.columns('terceiro')]


for r in c.execute('select top 100 * from terceiro'):
    print r.Nome


con.close()    

Aug 17, 2012
#3 alexandr...@gmail.com
By the way thank you for pyodbc, I'm changing a lot of stuff to it, and will do more.
Will try do run django width it.
Sep 26, 2012
Project Member #4 mkleehammer
(No comment was entered for this change.)
Status: NoFix