Hi all,
I have a issue.
I define a table
db.define_table('department',
Field('name', 'string')
)
In controller, I use like this:
sql = 'select name from department'
rows = db.execute(sql)
for row in rows:
print row.name
I get an error: 'Row' object has no attribute 'name'.
When i use eclipse to debug, I saw Row is LIST, not is object like when use
DAL. But I don't want to use DAL, and want to execute sql statement.
I use web2py 2.12.3, python 2.7.8, MSSQL 2008 R2
Please help me. Regard!
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.