Thread: is this a odbc bug?

is this a odbc bug?

From
Hugo
Date:
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') ))

*****

Re: is this a odbc bug?

From
"Dave Page"
Date:
-----Original Message-----
From: "Hugo"<htakada@gmail.com>
Sent: 15/11/05 18:52:04
To: "pgsql-odbc@postgresql.org"<pgsql-odbc@postgresql.org>
Subject: [ODBC] is this a odbc bug?

>. now I installed the 8.1.0 plus the odbc driver ,
> and now my application is returning wrong results ,

Upgrade to 08.01.0101 and sanity should return :-)

Regards, Dave

-----Unmodified Original Message-----
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') ))

*****
 <pgsql-odbc@postgresql.org>