[DB-SIG] cx_Oracle and Unicode ???

Mark Bennett mbennett at ideaeng.com
Thu May 5 15:02:22 CEST 2005


Good morning Folks,

I've looked around on Google for this a few times and really haven't come up
with anything definitive.

I'm trying to update values in Oracle with the .execute() method from
cx_Oracle.

If I create a Python unicode string object and try to pass it in, Python
complains that .execute() expects a None or string.

If I convert the unicode string to a regular "byte" string beforehand with
.encode() and utf-8, Python accepts it but when we pull the data back from
Oracle we get garbage characters.

Some details:

Python 2.4 with a recent version of cx_Oracle (don't have the exact version
here)  Running on Solaris.

And from our DBA:

Oracle 9 on Solaris.  The database was told to support Unicode.

The character fields are currently VARCHAR2; he believes he's seen
conflicting evidence online about whether or not that is supposed to work.
We've also talked about using NVARCHAR2 and NCLOB.

We have not set any environment variables on Solaris.

Thanks in advance,
Mark
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/db-sig/attachments/20050505/a94a10f9/attachment.htm


More information about the DB-SIG mailing list