On May 18, 2010, at 11:31 AM, Kent wrote:

> cx_Oracle-5.0.2
> 
> This is what is causing the error:
> ===============================================================================
> SELECT CAST('test unicode returns' AS NVARCHAR2(60)) AS anon_1 FROM
> DUAL
>            *
> ERROR at line 1:
> ORA-12704: character set mismatch
> ===============================================================================
> 
> I believe all we need is inside
> def _check_unicode_returns(self, connection):
> ...
> ...
>        try:
>            unicode_for_unicode = check_unicode(sqltypes.Unicode(60))
>        except exc.DBAPIError, e:
>            util.warn("Exception while detecting unicode returns: %s"
> % e)
>            unicode_for_unicode = False
> 
> 
> change the except to include cx_Oracle.DatabaseError instead of only
> exc.DBAPIError

OK we can't do that since that module assumes no DBAPI, but my fix is wrong 
because its calling the cursor directly and our own DBAPIError wrapping isn't 
taking effect.  We'd have to use plain Exception.

> 
> But, my preference would be that it just not check if the version of
> oracle is lower than 9, because it just saves the check from the
> database for something we know will fail, can it just set
> unicode_for_unicode = False
> for Oracle lower than 9?

I don't know that that's the case.     Oracle 8 client library does unicode 
AFAIK the same as versions which are higher, and I'm not sure if here the 
behavior would be different if you had NLS_LANG set, for example.

The statement that is running the second time around should be:

SELECT CAST('test unicode returns' AS NVARCHAR(60)) AS anon_1 FROM DUAL

then it seems like either that fails directly, or it fails when the client gets 
a hold of it.   See what happens with that statement.   Not sure that Oracle 8 
has NVARCHAR which might be the issue.




-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalch...@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