Hi Anthony, Are you showing the *exact* code? That is simple code to understand easily. In my app, I use storeproceduce.
Did you copy the exact application from one machine and move it to another, or are there any differences at all? My code is same in anywhere. "pass in fields". I don't know it. Can you explane clearly? When sue .executesql, how do I do to get result as Rows or how must i convert result to Rows object? Thanks and Regard! Vào 23:32:17 UTC+7 Thứ Hai, ngày 26 tháng 10 năm 2015, Anthony đã viết: > > .executesql() doesn't return a Rows object unless you pass in fields. Are > you showing the *exact* code? Did you copy the exact application from one > machine and move it to another, or are there any differences at all? > > Anthony > > On Monday, October 26, 2015 at 3:29:40 AM UTC-4, DucVa wrote: >> >> Hi all, >> I define a table as below: >> db.define_table('partner', >> Field('name') >> ) >> In controller, I use execute to get data: >> sql = 'select name from partner' >> rows = db.executesql(sql) >> In my laptop, type of rows is LIST, but in other computer in my company, >> type of rows is ROWS. >> So, when i print data, raise error. >> for row in rows: >> print row.name >> I get an error: 'Row' object has no attribute 'name'. >> But in other computer, my code runs very well. >> 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 web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.