Re: [cx-oracle-users] Unicode issue
Brought to you by:
atuining
From: Waldemar O. <wal...@gm...> - 2012-01-16 17:01:56
|
On Sat, Jan 14, 2012 at 19:57, Anthony Tuininga <ant...@gm...> wrote: > See below. > > On Sat, Jan 14, 2012 at 2:17 AM, Uwe Hoffmann <uw...@fa...> wrote: >> Hi Anthony, >> >> see below. > Well, everything is converted to string, as it turns out, so there is > no performance problem as Oracle is perfectly fine with accepting > string and converting it to Unicode but the reverse is not true. That > suggests, of course, that I should be doing the same thing in both > versions of Python but to be perfectly honest it never really crossed > my mind. :-) I'll give it some thought. > Here is an observation that may matter in the discussion. Passing "number like" unicode parameters worked in 5.04 but stopped working in 5.1 It works again with 5.1 and Python3 C:\>python Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import cx_Oracle as dbi >>> dbi.version '5.0.4' >>> conn = dbi.connect('user/password@dbname') >>> cur = conn.cursor() >>> cur.execute('select * from stkhldr where stkhldr_id = :sid', sid=u'48') <__builtin__.OracleCursor on <cx_Oracle.Connection to skhd@milenet_d>> C:\>python Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import cx_Oracle as dbi >>> dbi.version '5.1.1' >>> conn = dbi.connect(u'user/passwd@dbname') >>> cur = conn.cursor() >>> cur.execute('select * from stkhldr where stkhldr_id = :sid', sid=u'48') Traceback (most recent call last): File "<stdin>", line 1, in <module> cx_Oracle.DatabaseError: ORA-01460: unimplemented or unreasonable conversion requested |