[DB-SIG] Re: Returning floats in DCOracle2

Paul D. Lusk plusk@radford.edu
Mon, 2 Dec 2002 16:44:36 +0000 (UTC)


Alexei Ustyuzhaninov <alust@UralskyGSM.com> wrote in news:3DE73A1C.5020901
@UralskyGSM.com:

> Hi!
> 
> I have ran into a silly problem with DCOracle2. It returns wrong float 
> numbers from SELECT statement.
> 
> bash-2.04$ cat test.py
> import DCOracle2
> db = DCOracle2.connect("x/y@z")
> c = db.cursor()
> c.execute("SELECT 0.5 FROM DUAL")
> print c.fetchone()
> 
> bash-2.04$ python test.py
> [3.6097722056218853]
> 
> Unfortunately 0.5 is somewhat different from 3.6097722056218853.
> The environment is:
> HP-UX 11.11
> python 2.2.2
> DCOracle2 1.2
> 
> Could somebody give me a tip on the problem please?
> 

I can't reproduce your problem either, and as best I can my setup is 
exactly like yours.

>>>> cur = dbutils.conn.cursor()
>>>> cur.execute('select 0.5 from dual')
> 1
>>>> r = cur.fetchone()
>>>> print r
> [0.5]
>>>> 
> plusk@falcon> uname -a
> HP-UX falcon B.11.11 U 9000/800 110901527 unlimited-user license
> plusk@falcon> pyth.sh
> Python 2.2.2 (#3, Oct 23 2002, 11:37:42) [C] on hp-ux11
> Type "help", "copyright", "credits" or "license" for more information.
>>>> 
DCOracle2 version

# $Id: DCOracle2.py,v 1.84 2002/04/11 18:21:18 matt Exp $

Paul