this is ticket #800 in trac, which will be fixed soon. in the meantime, heres a patch you can apply which will fix for now:
http://www.sqlalchemy.org/trac/attachment/ticket/800/patch.diff On Oct 4, 2007, at 5:25 AM, Moo wrote: > > Hi all. > I'm trying to switch from SA 0.3 to 0.4. I tested simple SELECT, I've > got a NotSupportedError. > > Python: 2.5.1 > SQLAlchemy: 0.4 beta6 > cx_Oracle: 4.3.2 > Environment variable: NLS_LANG=JAPANESE_JAPAN.JA16SJIS > > > sample code) > ----------------------------------------------------------------- > from sqlalchemy import * > from sqlalchemy.orm import * > > oracle_engine = create_engine('oracle://scott:[EMAIL PROTECTED]', > convert_unicode=True, > encoding='cp932', > echo=True) > metadata = MetaData(oracle_engine) > Session = scoped_session(sessionmaker(bind=ora_engine, > autoflush=False, > transactional=True)) > > class Emp(object): > pass > > emp = Table('emp', metadata, autoload=True) > > Session.mapper(Emp, emp) > > if __name__ == '__main__': > smith = Emp.query.filter_by(ename='SMITH').first() > print smith.job, type(smith.job) > ----------------------------------------------------------------- > > > traceback) > ----------------------------------------------------------------- > Traceback (most recent call last): > File "model.py", line 19, in <module> > emp = Table('emp', metadata, autoload=True) > File "build\bdist.win32\egg\sqlalchemy\schema.py", line 114, in > __call__ > File "build\bdist.win32\egg\sqlalchemy\engine\base.py", line 1178, > in reflecttable > File "build\bdist.win32\egg\sqlalchemy\databases\oracle.py", line > 436, in reflecttable > File "build\bdist.win32\egg\sqlalchemy\engine\base.py", line 779, in > execute > File "build\bdist.win32\egg\sqlalchemy\engine\base.py", line 789, in > _execute_text > File "build\bdist.win32\egg\sqlalchemy\engine\base.py", line 852, in > __execute_raw > File "build\bdist.win32\egg\sqlalchemy\engine\base.py", line 869, in > _cursor_execute > sqlalchemy.exceptions.NotSupportedError: (NotSupportedError) > Variable_TypeByValue(): unhandled data type unicode 'select > COLUMN_NAME, DATA_TYPE, DATA_LENGTH, DATA_PRECISION, DATA_SCALE, > NULLABLE, DATA_DEFAULT from ALL_TAB_COLUMNS where TABLE_NAME > = :table_name and OWNER = :owner' {'owner': u'SCOTT', 'table_name': > 'EMP'} > ----------------------------------------------------------------- > > > When I removed convert_unicode=True, this error did not occur. But > type(smith.job) becomes '<str>'. How do I get '<unicode>'? > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---
