the probable change that revealed this error is that oracle in 0.3.6 will by default apply cursor.setinputsizes() to all queries, which is necessary for CLOB/BLOB. So encoding/NLS_LANG stuff probably became more significant once cx_oracle has less need to guess about bind parameters.
this option can be disabled by sending auto_setinputsizes=False to create_engine(). On Mar 27, 2007, at 2:48 PM, shday wrote: > > Okay, I changed the NLS_LANG setting on the oracle client to match > that of the server, and now it works. I found out about it here: > > http://www.theserverside.com/discussions/thread.tss?thread_id=14634 > > > > On Mar 27, 1:27 pm, "shday" <[EMAIL PROTECTED]> wrote: >> Hi, >> >> The table is reflected, with one column overridden, here: >> >> model_table = Table('model',metadata, >> >> Column('model_id',Numeric(precision=6,length=0),Sequence >> ('model_seq'), >> primary_key=True, nullable=False), >> autoload=True) >> >> Here is what the resulting Table object looks like: >> >> Table('model',DynamicMetaData(), >> Column('investigator_isid',OracleString(length=8),nullable=False), >> Column('active',OracleNumeric >> (precision=1,length=0),nullable=False,default= PassiveDefault >> (<sqlalchemy.sql._TextClause >> object at 0x0193E850>)), >> Column('model_id',Numeric >> (precision=6,length=0),primary_key=True,nullable=F alse, >> default=Sequence >> ('model_seq',start=None,increment=None,optional=False)), >> Column('model_acronym',OracleString(length=32),nullable=False), >> Column('model_name',OracleString(length=256),nullable=False), >> Column('therapeutic_area',OracleString(length=32)), >> schema=None) >> >> On Mar 27, 12:12 pm, Michael Bayer <[EMAIL PROTECTED]> wrote: >> >> >> >>> this is most likely a typing error and id need to see the types of >>> columns being used. in particular if you have any "String" columns >>> without a size, they are now interpreted as CLOBs which might be >>> where its tripping up. >> >>> On Mar 27, 2007, at 10:35 AM, shday wrote: >> >>>> Here is the surrounding code: >> >>>> def model_list(therapeutic_area='All'): >>>> if therapeutic_area == 'All': >>>> s = model_table.select(order_by= >>>> [model_table.c.model_acronym]) >>>> elif therapeutic_area == 'Other': >>>> s = >>>> model_table.select(~(model_table.c.therapeutic_area.in_ >>>> ('Respiratory','Diabetes', >> >>>> 'Inflammation','CVD')), >>>> order_by= >>>> [model_table.c.model_acronym]) >>>> else: >>>> s = >>>> model_table.select >>>> (model_table.c.therapeutic_area==therapeutic_area,order_by= >>>> [model_table.c.model_acronym]) >>>> rs = s.execute() >>>> return [(str(row['model_id']),(row['model_acronym'] +" - >>>> "+row['model_name'])[:80]) for row in rs.fetchall()] >> >>>> On Mar 27, 10:29 am, "shday" <[EMAIL PROTECTED]> wrote: >>>>> I upgraded to 0.3.6 from 0.3.5 and one of my querys stopped >>>>> working: >> >>>>> s = >>>>> model_table.select(~(model_table.c.therapeutic_area.in_ >>>>> ('Respiratory','Diab etes', >> >>>>> 'Inflammation','CVD')), >>>>> order_by= >>>>> [model_table.c.model_acronym]) >> >>>>> All my other query still work fine. Although this is the only one >>>>> using in_() and "~". >> >>>>> The funny thing is that the created sql appears to be exactly the >>>>> same >>>>> as before. Here is the error: >> >>>>> 2007-03-26 15:11:20,851 INFO sqlalchemy.engine.base.Engine.0x..d0 >>>>> SELECT model.i >>>>> nvestigator_isid, model.active, model.model_id, >>>>> model.model_acronym, >>>>> model.model >>>>> _name, model.therapeutic_area >>>>> FROM model >>>>> WHERE model.therapeutic_area NOT IN >>>>> (:model_therapeutic_area, :model_therapeutic >>>>> _ar_1, :model_therapeutic_ar_2, :model_therapeutic_ar_3) ORDER BY >>>>> model.model_ac >>>>> ronym >>>>> 2007-03-26 15:11:20,851 sqlalchemy.engine.base.Engine.0x..d0 INFO >>>>> SELECT model.i >>>>> nvestigator_isid, model.active, model.model_id, >>>>> model.model_acronym, >>>>> model.model >>>>> _name, model.therapeutic_area >>>>> FROM model >>>>> WHERE model.therapeutic_area NOT IN >>>>> (:model_therapeutic_area, :model_therapeutic >>>>> _ar_1, :model_therapeutic_ar_2, :model_therapeutic_ar_3) ORDER BY >>>>> model.model_ac >>>>> ronym >>>>> 2007-03-26 15:11:20,861 INFO sqlalchemy.engine.base.Engine.0x..d0 >>>>> {'model_therap >>>>> eutic_area': 'Respiratory', 'model_therapeutic_ar_3': 'CVD', >>>>> 'model_therapeutic_ >>>>> ar_2': 'Inflammation', 'model_therapeutic_ar_1': 'Diabetes'} >>>>> 2007-03-26 15:11:20,861 sqlalchemy.engine.base.Engine.0x..d0 INFO >>>>> {'model_therap >>>>> eutic_area': 'Respiratory', 'model_therapeutic_ar_3': 'CVD', >>>>> 'model_therapeutic_ >>>>> ar_2': 'Inflammation', 'model_therapeutic_ar_1': 'Diabetes'} >>>>> 2007-03-26 15:11:20,861 INFO sqlalchemy.engine.base.Engine.0x..d0 >>>>> ROLLBACK >>>>> 2007-03-26 15:11:20,861 sqlalchemy.engine.base.Engine.0x..d0 INFO >>>>> ROLLBACK >>>>> Traceback (most recent call last): >>>>> File "C:\Documents and Settings\Daystev\Desktop\srt-trunk\srt- >>>>> project >>>>> \start-sr >>>>> t.py", line 23, in ? >>>>> from srt.controllers import Root >>>>> File "C:\Documents and Settings\Daystev\Desktop\srt-trunk\srt- >>>>> project >>>>> \srt\cont >>>>> rollers.py", line 9, in ? >>>>> model_list = [('Respiratory',[('','Please select a model')] >>>>> +dbmodel.model_li >>>>> st('Respiratory')), >>>>> File "C:\Documents and Settings\Daystev\Desktop\srt-trunk\srt- >>>>> project >>>>> \srt\mode >>>>> l.py", line 158, in model_list >>>>> rs = s.execute() >>>>> File "c:\python24\lib\site-packages\sqlalchemy-0.3.6-py2.4.egg >>>>> \sqlalchemy\sql. >>>>> py", line 776, in execute >>>>> return self.compile(engine=self.engine, >>>>> parameters=compile_params).execute(* >>>>> multiparams, **params) >>>>> File "c:\python24\lib\site-packages\sqlalchemy-0.3.6-py2.4.egg >>>>> \sqlalchemy\sql. >>>>> py", line 669, in execute >>>>> return e.execute_compiled(self, *multiparams, **params) >>>>> File "c:\python24\lib\site-packages\sqlalchemy-0.3.6-py2.4.egg >>>>> \sqlalchemy\engi >>>>> ne\base.py", line 726, in execute_compiled >>>>> return connection.execute_compiled(compiled, *multiparams, >>>>> **params) >>>>> File "c:\python24\lib\site-packages\sqlalchemy-0.3.6-py2.4.egg >>>>> \sqlalchemy\engi >>>>> ne\base.py", line 503, in execute_compiled >>>>> proxy(str(compiled), parameters) >>>>> File "c:\python24\lib\site-packages\sqlalchemy-0.3.6-py2.4.egg >>>>> \sqlalchemy\engi >>>>> ne\base.py", line 499, in proxy >>>>> self._execute_raw(statement, parameters, cursor=cursor, >>>>> context=context) >>>>> File "c:\python24\lib\site-packages\sqlalchemy-0.3.6-py2.4.egg >>>>> \sqlalchemy\engi >>>>> ne\base.py", line 547, in _execute_raw >>>>> self._execute(cursor, statement, parameters, context=context) >>>>> File "c:\python24\lib\site-packages\sqlalchemy-0.3.6-py2.4.egg >>>>> \sqlalchemy\engi >>>>> ne\base.py", line 566, in _execute >>>>> raise exceptions.SQLError(statement, parameters, e) >>>>> sqlalchemy.exceptions.SQLError: (DatabaseError) ORA-01460: >>>>> unimplemented or unre >>>>> asonable conversion requested >>>>> 'SELECT model.investigator_isid, model.active, model.model_id, >>>>> model.model_acro >>>>> nym, model.model_name, model.therapeutic_area \nFROM model \nWHERE >>>>> model.therape >>>>> utic_area NOT IN >>>>> (:model_therapeutic_area, :model_therapeutic_ar_1, :model_thera >>>>> peutic_ar_2, :model_therapeutic_ar_3) ORDER BY >>>>> model.model_acronym' {'model_ther >>>>> apeutic_area': 'Respiratory', 'model_therapeutic_ar_3': 'CVD', >>>>> 'model_therapeuti >>>>> c_ar_2': 'Inflammation', 'model_therapeutic_ar_1': 'Diabetes'}- >>>>> Hide quoted text - >> >>> - Show quoted text -- Hide quoted text - >> >> - Show quoted text - > > > > --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---