On Friday 12 December 2008 12:19:44 jo wrote: > Michael Bayer ha scritto: > > Look into using the Unicode type for python unicode values. > > > > http://www.sqlalchemy.org/docs/05/reference/sqlalchemy/types.html > >?highlight=unicode#sqlalchemy.Unicode > > This is the 0.5 documentation > I'm using SQLAlchemy version 0.3.10. > and cx_Oracle 4.3.1 > > Seems cx_Oracle isn't able to convert unicode values into integer. who does? are your primary keys strings or what? just do int()
> Take a look: > > In [32]: print Azienda.get(1).azienda_id > 1 > > > In [33]: print Azienda.id(u'1').azienda_id > SQLError: (NotSupportedError) Variable_TypeByValue(): unhandled > data type unicode 'SELECT azienda.id AS azienda_id \nFROM azienda > \nWHERE azienda.id = :azienda_id ORDER BY azienda.rowid' > {'azienda_id': u'1'} > > j > > > On Dec 11, 2008, at 12:01 PM, jo wrote: > >> Hi all, > >> > >> I'm using SA with cx_Oracle. In some queries it raises the > >> following error: > >> > >> > >> File > >> "/usr/lib/python2.4/site-packages/sqlalchemy/engine/base.py", > >> line 581, in _execute_raw > >> self._execute(context) > >> File > >> "/usr/lib/python2.4/site-packages/sqlalchemy/engine/base.py", > >> line 599, in _execute > >> raise exceptions.SQLError(context.statement, > >> context.parameters, e) SQLError: (NotSupportedError) > >> Variable_TypeByValue(): unhandled data type unicode > >> 'SELECT comune.data_fine AS comune_data_fine, comune.id AS > >> comune_id, comune.auto_sync_bdn AS comune_auto_sync_bdn, > >> comune.cod_provincia AS comune_cod_provincia, comune.istat AS > >> comune_istat, comune.data_inizio AS comune_data_inizio, > >> comune.cap AS comune_cap, comune.codice_erariale AS > >> comune_codice_erariale, comune.bdn_id AS comune_bdn_id, > >> comune.nome AS comune_nome > >> \nFROM comune > >> \nWHERE comune.id = :comune_id ORDER BY comune.rowid' > >> {'comune_id': u'2895'} > >> > >> > >> Someone could help me? > >> > >> j --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---