[Zope] PostgreSQL money weird problem
Cesar A. K. Grossmann
ckant@uol.com.br
Fri, 03 Mar 2000 22:42:34 -0300
Hi,
I'm with a weird problem with a report from a SQL database. I have a
field of type 'money', and every time I use it in a SELECT query, it
returns 0.00, doesn't matter the actual value of the field (in the
example bellow - the 'test' of the query -, the field Valor is of type
'money'):
Id | Idcliente | Data | Valor
1 | 11 | 03-03-2000 | 0.0
2 | 11 | 03-03-2000 | 0.0
3 | 11 | 03-03-2000 | 0.0
SQL used:
select *
from compras
where idcliente=11
Running the same query on the interactive client, gives the value of
money:
credito=> select * from compras where idcliente=11;
id|idcliente| data|valor
--+---------+----------+--------
1| 11|03-03-2000|R$50,00
2| 11|03-03-2000|R$150,00
3| 11|03-03-2000|R$15,00
(3 rows)
I'm using Zope 2.1.2, ZPyGreSQLDA, and PostgreSQL 6.4.2, running in a
Conectiva Linux 4.0 (kernel version is 2.2.5).
The definition of the class compras is:
Table = compras
+--------------+----------------------------------+-------+
| Field | Type | Length|
+--------------+----------------------------------+-------+
| id | int4 not null default nextval('c | 4 |
| idcliente | int4 | 4 |
| data | date | 4 |
| valor | money | 4 |
+--------------+----------------------------------+-------+
Indices: compras_id_key
compras_pkey
TIA
--
Cesar A. K. Grossmann - AOLIM CesarAKG - ICQ# 53373705
http://members.xoom.com/ckant/
...when you are obsessed with the enemy, you become the enemy.