[DB-SIG]DCOracle2 rounded floats

Benjamin DULON BDULON at sqli.com
Fri May 28 12:04:39 EDT 2004


Thanks, I effectively tried with cx_Oracle, and everything goes right now !
Very curious ...

Benjamin DULON.


Why don't you try cx_Oracle instead? At least if you run into problems 
with it I can help you. :-) You can acquire a copy from

http://starship.python.net/crew/atuining

Anthony

Benjamin DULON wrote:
> Hi,
> 
>  
> 
> I haven't got any response, nobody has encountered this problem ? I 
> think I need to recompile DCO2, but I can't get any information about 
> configurations' options.
> 
> It seems that it returns float type as default.
> 
>  
> 
> DCO2 is installed under RedHat 9.
> 
>  
> 
> Any help will be appreciated.
> 
>  
> 
> Thanks,
> 
>  
> 
> Benjamin DULON.
> 
>  
> 
>  
> 
> Hello,
> 
>  
> 
> I'm newbie in DCO2 and python, and I encounter an issue.
> 
> In Oracle8i, I try to get Number data type. From SQLPlus, no problem, 
> but using dco2, floats are rounded.
> 
> Instead of having 0.975 I get 1.0
> 
> My code :
> 
>  
> 
>             Conn = DCOracle2.connect(connect_string)
> 
>             C = conn.cursor()
> 
>             c.execute('select * from t_sqli where id=4')
> 
>             r = c.fetchall()
> 
>             print entry
> 
>  
> 
> It returns : [4.0,'QUATRE','d',3.0]
> 
>  
> 
> It should be : [4,'QUATRE','d',3.1414155225]
> 
>  
> 
> Trying directly in using sqlplus : no problem.
> 
> The environnement is Python2.2, DCO2, RedHat9, Oracle8.1.7
> 
>  
> 
> Thanks a lot.
> 
>  
> 
> Benjamin DULON.
> 
>  
> 
>  
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> DB-SIG maillist  -  DB-SIG at python.org
> http://mail.python.org/mailman/listinfo/db-sig



More information about the DB-SIG mailing list