odbc and psql 8.1.0

From: Hugo <htakada(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: odbc and psql 8.1.0
Date: 2005-11-14 13:42:07
Message-ID: f3d9ba990511140542i70c0edd6i@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi , has anybody experienced any problem with the odbc driver that comes
with postgres 8.1.0 , I was testing my application against the beta 4 and
everything was working OK, now I installed the 8.1.0 plus the odbc driver ,
and now my application is returning wrong results , the application is the
same, no one modification was done, if I run my query from withing the
interactive sql editor of pgAdmin, the query returns what it is supposed to
return, the same query from my application doesnt work ( I tested the query
in PowerBulder 8 and VASmalltalk 7 both with same wrong result).

I would appreciate any hint on this

thanks in advance

Hugo

below is the query, this query should return rows with D's and P's , but it
returns only rows with D's, the problem is that if I count the rows I
realize that it returns all the rows it should (642), but it returns all of
them with D's, if I run the same query from pgAdmin it returns all the
rows(642) but with the correct values , 412 P's and 230 D's

*****
select distinct 'D' as estado , zona, ano, campana , contrato
from comisiones.avon as avon
where zona = :zona and ano = :ano and campana = :campana
and tipo in ('50')
and subtipo in ('02' , '03')
group by zona, ano, campana , contrato

union

select distinct 'D' as estado , zona, ano, campana , contrato
from comisiones.viru as viru
where zona = :zona and ano = :ano and campana = :campana
and tipo in ('50')
and subtipo in ('02' , '03')
group by zona, ano, campana , contrato

union

select distinct 'P' as estado, zona, ano, campana , contrato
from comisiones.avon as avon
where zona = :zona and ano = :ano and campana = :campana
and tipo in ('10', '20')
and subtipo in ('01')
and contrato not in (
select distinct contrato
from comisiones.viru as viru
where zona = :zona and ano = :ano and campana = :campana
and tipo in ('10', '20')
and subtipo in ('01')

)
group by zona, ano, campana , contrato

union

select distinct 'P' as estado, zona, ano, campana , contrato
from comisiones.viru as viru
where zona = :zona and ano = :ano and campana = :campana
and tipo in ('10', '20')
and subtipo in ('01')
and contrato not in (
select distinct contrato
from comisiones.avon as avon
where zona = :zona and ano = :ano and campana = :campana
and tipo in ('10', '20')
and subtipo in ('01')
)

group by zona, ano, campana , contrato

union
SELECT DISTINCT 'P' as estado, avon.zona as zona, avon.ano as ano ,
avon.campana as campana , avon.contrato
FROM comisiones.avon as avon,
comisiones.viru as viru
WHERE ( avon.zona = viru.zona ) and
( avon.contrato = viru.contrato ) and
( avon.ano = viru.ano ) and
( avon.campana = viru.campana ) and
avon.zona = :zona and avon.ano = :ano and avon.campana = :campana
and ( ( avon.tipo in ('10', '20')
and avon.subtipo in ('01') )
and ( viru.tipo in ('10', '20')
and viru.subtipo in ('01') ))

*****

Browse pgsql-general by date

  From Date Subject
Next Message Michał Otroszczenko 2005-11-14 13:45:22 Outer join with where conditions
Previous Message Johnny Ljunggren 2005-11-14 11:29:03 Re: Choosing PostgreSQL as the database for our next project