Database: table 'abc'

db.define_table('abc',
        db.Field('name', 'string'))
db.abc.insert(name='Hà Nội - Việt Nam')


On Mar 7, 10:46 pm, toan75 <toa...@gmail.com> wrote:
> Can use "executesql" in this case:
>
> My code:
>
>         rows = db.executesql('SELECT * FROM abc;',as_dict=True)
>         for row in rows:
>                 print row['name']
>
> ([name] is unicode field)
>
> Error traceback
> Traceback (most recent call last):
>   File "gluon/restricted.py", line 173, in restricted
>   File "E:/Web2py/web2py_win/applications/init/controllers/
> default.py", line 211, in <module>
>   File "gluon/globals.py", line 96, in <lambda>
>   File "E:/Web2py/web2py_win/applications/init/controllers/
> default.py", line 209, in dshuyen
>   File "encodings\cp437.pyc", line 12, in encode
> UnicodeEncodeError: 'charmap' codec can't encode character u'\u1ed1'
> in position 8: character maps to <undefined>

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.

Reply via email to