| Issue 197: | pyodbc db2 row object not showing colnames as fields | |
| 2 people starred this issue and may be notified of changes. | Back to list |
What steps will reproduce the problem?
1. import pyodbc
conn=pyodbc.connect('DSN=db;UID=xx;PWD=xxx')
cursor=conn.cursor()
cursor.execute('select id,name from test.test')
row = cursor.fetchone()
print row >> (211841, 'test')
print row.id or print row.name
'pyodbc.Row' object has no attribute 'id'
What is the expected output? What do you see instead?
wiki show's that Row object should have columnames as fields.
the only thing i can do is use
row.cursor_description
and create a Wraper which would generate a dict
What version of the product are you using? On what operating system?
pyodbc.version
'2.1.9'
DB2 client under osx lion 10.7
did build against unixodbc ( would be great to have a better setup.py to detect that unixodbc is installed)
i prefer to use unixodbc as it is available via brew
Please provide any additional information below:
i switched to pyodbc since ibm_db python does not work on osx 10.7
Aug 10, 2011
Project Member
#1
mkleehammer
Status:
Investigating
Aug 10, 2011
my bad they where upper case. pyodc.lowecase = True is the way to go. just moved to pyodbc as ibm_db is not supported anymore under osx 10.7 . I will have a look at distutils to detect unixodbc without adding include and compile flags manually and do pull request on github. Thanks.
Sep 13, 2011
(No comment was entered for this change.)
Status:
NoFix
|