[DB-SIG] Re: Returning floats in DCOracle2

Matthew T. Kromer matt@zope.com
Mon, 16 Dec 2002 10:20:57 -0500


Alexei Ustyuzhaninov wrote:

> Yes, you are right. The matter was in the decimal separator. Setting 
> it manually to "." resolves the problem. Thank you for the help.
>
> bash-2.04$ cat test.py
> import DCOracle2
> db = DCOracle2.connect("x/y@z")
> c = db.cursor()
> c.execute("ALTER SESSION SET NLS_NUMERIC_CHARACTERS='. '")
> c.execute("SELECT 0.5 FROM DUAL")
> print c.fetchone()


I have some code checked into CVS now that should handle numeric 
conversion better; but it's not complete for stored procedures yet.  The 
newer code uses a different output format from Oracle (SQLT_VNU vs 
SQLT_STR) for numeric results.

The reason it isnt complete for stored procedures is that the SP code 
tries to coerce numeric binds into strings, and I havent modified that 
yet to handle the alternative format.

Anyway, the newer OCINumber based code will not require you to change 
your NLS_NUMERIC_CHARACTERS setting.