Mailing List Archive

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@zope.org
http://mail.zope.org/mailman/listinfo/zope-db
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@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
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@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@zope.org
http://mail.zope.org/mailman/listinfo/zope-db