On the most recent versions of cx Oracle you need to have the NLS_LANG 
environment variable set for proper unicode handling.  They temporarily made 
this step optional in the 5.0 series but they backtracked on that in 5.1.

If that doesn't fix the issue then check on the cx_oracle list, as you should 
be able to reproduce the behavior with a cx_oracle only script.   


On May 20, 2011, at 3:51 PM, Rodney Barnett wrote:

> I have a table in Oracle (10gXE) that has a VARCHAR2 (4000) column.
> Whenever I try to specify a value for the column that has more 2000
> characters using a python Unicode variable, I get "ORA-01461: can bind a
> LONG value only for insert into a LONG column".
> 
> When I explicitly encode this into a utf-8 str, the error does not occur.
> The string contains only ASCII characters and fewer than 4000 of them.
> 
> I have convert_unicode=True in my create_engine() call, but removing it
> doesn't change anything that I can see.
> 
> I'm using cx_Oracle 5.1 and SQLAlchemy 0.6.7.  The Oracle database
> characterset is AL32UTF8.
> 
> Is this expected behavior?
> 
> Rodney
> 
> -- 
> 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.
> 

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

Reply via email to