Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Zope: DB

total- variables does not work with MySQL 5.x

 

 

Zope db RSS feed   Index | Next | Previous | View Threaded


lukas.zapletal at gmail

Aug 30, 2007, 12:08 AM

Post #1 of 3 (803 views)
Permalink
total- variables does not work with MySQL 5.x

Hello,

I have a problem with "total-*" variables when suming results from
MySQL 5.x. It does not work with monetary (float) numbers - only with
integers. When trying to sum floats it cointanins nulls. IMHO the
reason is in a driver because it probably do not convert numbers in
national currency format (some countries, e.g. mine, do not use dot as
separator). The problem is that the driver is outdated and old.

Is there a fixaround? How could I for example convert the numbers
explicitely? Or how do I ovverride the behaviour of the code that is
responsible for the sumarizing?

Thanks

LZ

--
Lukas Zapletal
http://lukas.zapletalovi.com
_______________________________________________
Zope-DB mailing list
Zope-DB[at]zope.org
http://mail.zope.org/mailman/listinfo/zope-db


lists at zopyx

Aug 30, 2007, 12:12 AM

Post #2 of 3 (756 views)
Permalink
Re: total- variables does not work with MySQL 5.x [In reply to]

--On 30. August 2007 09:08:07 +0200 Lukas Zapletal
<lukas.zapletal[at]gmail.com> wrote:

> Hello,
>
> I have a problem with "total-*" variables when suming results from
> MySQL 5.x. It does not work with monetary (float) numbers - only with
> integers. When trying to sum floats it cointanins nulls. IMHO the
> reason is in a driver because it probably do not convert numbers in
> national currency format (some countries, e.g. mine, do not use dot as
> separator). The problem is that the driver is outdated and old.
>
> Is there a fixaround? How could I for example convert the numbers
> explicitely? Or how do I ovverride the behaviour of the code that is
> responsible for the sumarizing?
>

Not sure how your issue relates to Zope. Zope basically only generates the
queries using ZSQL methods and returns the results back. Check if this
error also happens when you connect directly to MySQL using the standard
Pytrhon DB-API.

Andreas


charlie at egenix

Aug 30, 2007, 1:49 AM

Post #3 of 3 (760 views)
Permalink
Re: total- variables does not work with MySQL 5.x [In reply to]

Am 30.08.2007, 09:08 Uhr, schrieb Lukas Zapletal
<lukas.zapletal[at]gmail.com>:

> Hello,
> I have a problem with "total-*" variables when suming results from
> MySQL 5.x. It does not work with monetary (float) numbers - only with
> integers. When trying to sum floats it cointanins nulls. IMHO the
> reason is in a driver because it probably do not convert numbers in
> national currency format (some countries, e.g. mine, do not use dot as
> separator). The problem is that the driver is outdated and old.

> Is there a fixaround? How could I for example convert the numbers
> explicitely? Or how do I ovverride the behaviour of the code that is
> responsible for the sumarizing?

I'm not familiar with this part of MySQL but if a conversion is required
then you will probably need to access Python's locale functions in which
case you can't use ZSQL that easily. I don't reckon the driver is broken
but you're better off asking the question on the Mysqldb list.

Charlie
--
Charlie Clark
eGenix.com

Professional Python Services directly from the Source
>>> Python/Zope Consulting and Support ... http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/
________________________________________________________________________

:::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,MacOSX for free ! ::::

eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48
D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
Registered at Amtsgericht Duesseldorf: HRB 46611
_______________________________________________
Zope-DB mailing list
Zope-DB[at]zope.org
http://mail.zope.org/mailman/listinfo/zope-db

Zope db RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.