On Feb 15, 2012, at 3:39 PM, Harish Tejwani wrote:

> Need help!
> 
> SQL Alchemy: 0.6.8
> cx_Oracle: 5.1.1
> Red-had Linux
> Oracle 11gR2, NLS_CHARACTERSET AL32UTF8
> 
> Simple Queries like
> 
> SELECT events.source_name AS events_source_name
> FROM events
> WHERE events.source_mac_id = :source_mac_id_1
> 
> 2012-02-15 10:07:13,061 INFO sqlalchemy.engine.base.Engine.0x...9410
> {'source_mac_id_1': u'991111111111A'}
> 
> Bind Variables has a 'u' prefixed that causes Oracle to do full TS as
> it uses SYS_OP_C2C to do conversion and ignores the index on columns.
> 
> class Event(Base):
>    '''
>    '''
> 
>    __tablename__ = "events"
> 
>    source_name = Column(BigInteger)
>    source_mac_id = Column(String(128))
> 
> ......
> 
> Tried all settings on engine connect side and also changing as below,
> still no help

SQLAlchemy never converts to a u'', however if this is data that's coming back 
from cx_oracle as a u'' being passed back again, that might be the cause.    If 
you don't pass in a u'' string, then it will remain as a plain bytestring.   

If you want to force it to encode even when a u'' is passed, use 
convert_unicode='force':

String(128, convert_unicode='force')

Though this really seems like a cx_oracle issue.  It shouldn't matter if u'' or 
'' is passed, the end result should be similar and this seems like some kind of 
Oracle mis-configuration.   You might want to ask on the cx_oracle list.




-- 
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.

Reply via email to