W. Craig Trader | 22 Sep 20:15 2010
Picon

Problem with cx_Oracle 5.0.4 and Unicode support for Oracle 10g

I'm trying to use cx_Oracle 5.0.4 on 64-bit RedHat EL 5.5 / CentOS 5.5) with Python 2.6 and Oracle 10g (client libraries 10.2.0).

When I build cx_Oracle without Unicode support, it all works as expected.  When I build cx_Oracle *with* Unicode support, attempting to use a query that returns a numeric value (such as):

con = Connection( ... )
cur = con.cursor()
cur.execute( 'SELECT 1 FROM DUAL' )
rows = cur.fetchall()

 results in this exception:

cx_Oracle.DatabaseError: OCI-22061: invalid format text [T

I've tried the SourceForge RPMs and I've tried installing from the source tar, and the results are consistent -- without Unicode works, with Unicode fails.

All help will be greatfully appreciated.

- Craig -

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
cx-oracle-users mailing list
cx-oracle-users@...
https://lists.sourceforge.net/lists/listinfo/cx-oracle-users
W. Craig Trader | 22 Sep 22:58 2010
Picon

Re: Problem with cx_Oracle 5.0.4 and Unicode support for Oracle 10g

Additional information:

When I look at the error context of the exception, the message is:

in NumberVar_GetValue(): as string

Which implies that the failure is in the call to OCINumberToText() at line 535 of NumberVar.c.

- Craig -

On Wed, Sep 22, 2010 at 14:15, W. Craig Trader <craig.trader-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
I'm trying to use cx_Oracle 5.0.4 on 64-bit RedHat EL 5.5 / CentOS 5.5) with Python 2.6 and Oracle 10g (client libraries 10.2.0).

When I build cx_Oracle without Unicode support, it all works as expected.  When I build cx_Oracle *with* Unicode support, attempting to use a query that returns a numeric value (such as):

con = Connection( ... )
cur = con.cursor()
cur.execute( 'SELECT 1 FROM DUAL' )
rows = cur.fetchall()

 results in this exception:

cx_Oracle.DatabaseError: OCI-22061: invalid format text [T

I've tried the SourceForge RPMs and I've tried installing from the source tar, and the results are consistent -- without Unicode works, with Unicode fails.

All help will be greatfully appreciated.

- Craig -


------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
cx-oracle-users mailing list
cx-oracle-users@...
https://lists.sourceforge.net/lists/listinfo/cx-oracle-users
Anthony Tuininga | 22 Sep 23:36 2010
Picon

Re: Problem with cx_Oracle 5.0.4 and Unicode support for Oracle 10g

Hi,

I can see that problem myself in certain situations as well -- not
sure what the problem is but I suspect a bug in Oracle on certain
platforms. I have asked Oracle about it but have not received any
information to date. Based on other bugs that I have seen and some
other comments made on and off the list I am thinking that Unicode
mode is not worth the trouble and I am thinking of ripping it out
completely. In the meantime, so long as you can live without metadata
in unicode the normal mode works fine with unicode data passed in to
queries. If you want unicode returned, you can use a output type
converter method -- see the samples for an example. Hope that helps.

Anthony

On Wed, Sep 22, 2010 at 2:58 PM, W. Craig Trader
<craig.trader@...> wrote:
> Additional information:
>
> When I look at the error context of the exception, the message is:
>
> in NumberVar_GetValue(): as string
>
> Which implies that the failure is in the call to OCINumberToText() at line
> 535 of NumberVar.c.
>
> - Craig -
>
> On Wed, Sep 22, 2010 at 14:15, W. Craig Trader <craig.trader@...>
> wrote:
>>
>> I'm trying to use cx_Oracle 5.0.4 on 64-bit RedHat EL 5.5 / CentOS 5.5)
>> with Python 2.6 and Oracle 10g (client libraries 10.2.0).
>>
>> When I build cx_Oracle without Unicode support, it all works as expected.
>> When I build cx_Oracle *with* Unicode support, attempting to use a query
>> that returns a numeric value (such as):
>>
>> con = Connection( ... )
>> cur = con.cursor()
>> cur.execute( 'SELECT 1 FROM DUAL' )
>> rows = cur.fetchall()
>>
>>  results in this exception:
>>
>> cx_Oracle.DatabaseError: OCI-22061: invalid format text [T
>>
>> I've tried the SourceForge RPMs and I've tried installing from the source
>> tar, and the results are consistent -- without Unicode works, with Unicode
>> fails.
>>
>> All help will be greatfully appreciated.
>>
>> - Craig -
>>
>
>
> ------------------------------------------------------------------------------
> Start uncovering the many advantages of virtual appliances
> and start using them to simplify application deployment and
> accelerate your shift to cloud computing.
> http://p.sf.net/sfu/novell-sfdev2dev
> _______________________________________________
> cx-oracle-users mailing list
> cx-oracle-users@...
> https://lists.sourceforge.net/lists/listinfo/cx-oracle-users
>
>

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
W. Craig Trader | 23 Sep 00:01 2010
Picon

Re: Problem with cx_Oracle 5.0.4 and Unicode support for Oracle 10g

Anthony ...

Thanks for the quick response. 

Irritating (but not surprising) that Oracle is ignoring you -- Oracle suffers from Not Invented Here syndrome.

In any case, thanks for all of the work putting together cx_Oracle.

- Craig -

On Wed, Sep 22, 2010 at 17:36, Anthony Tuininga <anthony.tuininga-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
Hi,

I can see that problem myself in certain situations as well -- not
sure what the problem is but I suspect a bug in Oracle on certain
platforms. I have asked Oracle about it but have not received any
information to date. Based on other bugs that I have seen and some
other comments made on and off the list I am thinking that Unicode
mode is not worth the trouble and I am thinking of ripping it out
completely. In the meantime, so long as you can live without metadata
in unicode the normal mode works fine with unicode data passed in to
queries. If you want unicode returned, you can use a output type
converter method -- see the samples for an example. Hope that helps.

Anthony

On Wed, Sep 22, 2010 at 2:58 PM, W. Craig Trader <craig.trader-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> Additional information:
>
> When I look at the error context of the exception, the message is:
>
> in NumberVar_GetValue(): as string
>
> Which implies that the failure is in the call to OCINumberToText() at line
> 535 of NumberVar.c.
>
> - Craig -
>
> On Wed, Sep 22, 2010 at 14:15, W. Craig Trader <craig.trader-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> wrote:
>>
>> I'm trying to use cx_Oracle 5.0.4 on 64-bit RedHat EL 5.5 / CentOS 5.5)
>> with Python 2.6 and Oracle 10g (client libraries 10.2.0).
>>
>> When I build cx_Oracle without Unicode support, it all works as expected.
>> When I build cx_Oracle *with* Unicode support, attempting to use a query
>> that returns a numeric value (such as):
>>
>> con = Connection( ... )
>> cur = con.cursor()
>> cur.execute( 'SELECT 1 FROM DUAL' )
>> rows = cur.fetchall()
>>
>>  results in this exception:
>>
>> cx_Oracle.DatabaseError: OCI-22061: invalid format text [T
>>
>> I've tried the SourceForge RPMs and I've tried installing from the source
>> tar, and the results are consistent -- without Unicode works, with Unicode
>> fails.
>>
>> All help will be greatfully appreciated.
>>
>> - Craig -

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
cx-oracle-users mailing list
cx-oracle-users@...
https://lists.sourceforge.net/lists/listinfo/cx-oracle-users
Amaury Forgeot d'Arc | 23 Sep 00:13 2010
Picon

Re: Problem with cx_Oracle 5.0.4 and Unicode support for Oracle 10g

Hi,

2010/9/22 Anthony Tuininga <anthony.tuininga@...>:
> Based on other bugs that I have seen and some
> other comments made on and off the list I am thinking that Unicode
> mode is not worth the trouble and I am thinking of ripping it out
> completely

Isn't the Unicode mode mandatory for python 3.x?

--

-- 
Amaury Forgeot d'Arc

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
Anthony Tuininga | 23 Sep 00:20 2010
Picon

Re: Problem with cx_Oracle 5.0.4 and Unicode support for Oracle 10g

On Wed, Sep 22, 2010 at 4:13 PM, Amaury Forgeot d'Arc
<amauryfa@...> wrote:
> Hi,
>
> 2010/9/22 Anthony Tuininga <anthony.tuininga@...>:
>> Based on other bugs that I have seen and some
>> other comments made on and off the list I am thinking that Unicode
>> mode is not worth the trouble and I am thinking of ripping it out
>> completely
>
> Isn't the Unicode mode mandatory for python 3.x?

Yes, indeed at the moment. I am considering simply forcing the
encoding of the unicode objects to the encoding expected by the
setting of NLS_LANG -- that should work well enough and avoid the code
path that doesn't seem to work well on certain platforms. I believe
that bindnames() also segfaults in unicode mode. There was another
problem but that one was resolved in the latest patchset for 11.2.

Anthony

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
W. Craig Trader | 22 Sep 23:50 2010
Picon

Re: Problem with cx_Oracle 5.0.4 and Unicode support for Oracle 10g

Further information:

I checked the documentation for OCINumberToText() and it referred me to TO_NUMBER().  The call to OCINumberToText is passing in g_ShortNumberToStringFormatObj, which is set to 'TM9'.  When I used sqlplus to run some tests, I discovered that while Oracle is fine with SELECT TO_NUMBER ( '1' ) FROM DUAL, it becomes most unhappy when you try SELECT TO_NUMBER( '1', 'TM9' ) FROM DUAL, responding with ORA-01722: invalid number.  On the other hand, SELECT TO_CHAR( '1', 'TM9' ) FROM DUAL works just fine.

It would appear that Oracle 10g does NOT like the 'TM9' conversion () for numbers.

- Craig -

On Wed, Sep 22, 2010 at 16:58, W. Craig Trader <craig.trader-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
Additional information:

When I look at the error context of the exception, the message is:

in NumberVar_GetValue(): as string

Which implies that the failure is in the call to OCINumberToText() at line 535 of NumberVar.c.

- Craig -


On Wed, Sep 22, 2010 at 14:15, W. Craig Trader <craig.trader <at> gmail.com> wrote:
I'm trying to use cx_Oracle 5.0.4 on 64-bit RedHat EL 5.5 / CentOS 5.5) with Python 2.6 and Oracle 10g (client libraries 10.2.0).

When I build cx_Oracle without Unicode support, it all works as expected.  When I build cx_Oracle *with* Unicode support, attempting to use a query that returns a numeric value (such as):

con = Connection( ... )
cur = con.cursor()
cur.execute( 'SELECT 1 FROM DUAL' )
rows = cur.fetchall()

 results in this exception:

cx_Oracle.DatabaseError: OCI-22061: invalid format text [T

I've tried the SourceForge RPMs and I've tried installing from the source tar, and the results are consistent -- without Unicode works, with Unicode fails.

All help will be greatfully appreciated.

- Craig -



------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
cx-oracle-users mailing list
cx-oracle-users@...
https://lists.sourceforge.net/lists/listinfo/cx-oracle-users

Gmane