What steps will reproduce the problem?
1. Have a table with a column named 2013.03.01
2. Fetch a row using a cursor
3. Try to manipulate data in the '2013.03.01' column in a for loop (for row in rows: )
What is the expected output? What do you see instead?
I would expect to get the data from the column, but I get syntax error:
print(row.2013.03.01)
^
SyntaxError: invalid syntax
print(row.'2013.03.01')
^
SyntaxError: invalid syntax
When I try to assign the column name to a variable such as colname (colname = str('2014.04.01')) and call row.colname, I get a object row has no attribute colname error.
for row in rows:
colname = str("2013.03.01")
print(row.colname)
AttributeError: 'pyodbc.Row' object has no attribute 'colname'
What version of the product are you using? On what operating system?
Python 2.7.6 | Anaconda 1.9.1 (64-bit)
pyodbc 3.0.7
Please provide any additional information below.
I also tried escaping the '.' with \ but that did not change anything either.