pg.ddx.io pgsql-interfaces@postgresql.org mailing list archive
help / color / mirror / Atom feedODBC handling of bools?
4+ messages / 3 participants
[nested] [flat]
* ODBC handling of bools?
@ 2000-12-17 09:35 Stephen Davies <scldad@sdc.com.au>
2000-12-18 13:39 ` RE: ODBC handling of bools? Francis Solomon <francis@stellison.co.uk>
0 siblings, 1 reply; 4+ messages in thread
From: Stephen Davies @ 2000-12-17 09:35 UTC (permalink / raw)
To: pgsql-interfaces
Hello.
I have a VB5 application which uses ODBC 6.5 (2/4/00) to access a Postgresql 7.0.2
database.
Everything works just fine except for booleans.
I manually generate the SQL to be sent to the ODBC driver ]
eg select * from member where weekends
or select * from member where weekends=true
but this fails because somewhere in the driver, this is translated to
select * from member where weekends <> 0 and this causes an error
because there is no operator to compare bools and integers.
I have tried with the "bools as char" option on and off with no effect.
I thought that this stuff had been fixed a couple of years ago. Did it
break again or am I just missing something basic?
How does one make bool tests work ?
Cheers and thanks,
Stephen Davies
========================================================================
Stephen Davies Consulting scldad@sdc.com.au
Adelaide, South Australia. Voice: 08-8177 1595
Computing & Network solutions. Fax: 08-8177 0133
^ permalink raw reply [nested|flat] 4+ messages in thread
* RE: ODBC handling of bools?
2000-12-17 09:35 ODBC handling of bools? Stephen Davies <scldad@sdc.com.au>
@ 2000-12-18 13:39 ` Francis Solomon <francis@stellison.co.uk>
0 siblings, 0 replies; 4+ messages in thread
From: Francis Solomon @ 2000-12-18 13:39 UTC (permalink / raw)
To: Stephen Davies <scldad@sdc.com.au>; pgsql-interfaces
Hi Stephen,
To test boolean values I use:
SELECT * FROM member WHERE weekends='t'
... and it works just fine through the ODBC driver.
(ODBC 6.50, PostgreSQL 7.02).
Hope this helps
Francis Solomon
> Hello.
>
> I have a VB5 application which uses ODBC 6.5 (2/4/00) to
> access a Postgresql 7.0.2
> database.
>
> Everything works just fine except for booleans.
>
> I manually generate the SQL to be sent to the ODBC driver ]
> eg select * from member where weekends
> or select * from member where weekends=true
>
> but this fails because somewhere in the driver, this is translated to
> select * from member where weekends <> 0 and this causes an error
> because there is no operator to compare bools and integers.
>
> I have tried with the "bools as char" option on and off with
> no effect.
>
> I thought that this stuff had been fixed a couple of years
> ago. Did it
> break again or am I just missing something basic?
>
> How does one make bool tests work ?
^ permalink raw reply [nested|flat] 4+ messages in thread
* RE: ODBC handling of bools?
@ 2000-12-17 15:41 Michael Davis <mdavis@sevainc.com>
0 siblings, 0 replies; 4+ messages in thread
From: Michael Davis @ 2000-12-17 15:41 UTC (permalink / raw)
To: 'Stephen Davies' <scldad@sdc.com.au>; pgsql-interfaces
In the ODBC driver configuration (click on the Driver button) and set
"Bools as Char" to on.
Michael Davis
Database Architect and Senior Software Engineer, Seva Inc.
Office: 303-460-7360 Fax: 303-460-7362
Mobile: 720-320-6971
Email: mdavis@sevainc.com
-----Original Message-----
From: Stephen Davies [SMTP:scldad@sdc.com.au]
Sent: Sunday, December 17, 2000 2:36 AM
To: pgsql-interfaces@postgresql.org
Subject: ODBC handling of bools?
Hello.
I have a VB5 application which uses ODBC 6.5 (2/4/00) to access a
Postgresql 7.0.2 database.
Everything works just fine except for booleans.
I manually generate the SQL to be sent to the ODBC driver ]
eg select * from member where weekends
or select * from member where weekends=true
but this fails because somewhere in the driver, this is translated to
select * from member where weekends <> 0 and this causes an error because
there is no operator to compare bools and integers.
I have tried with the "bools as char" option on and off with no effect.
I thought that this stuff had been fixed a couple of years ago. Did it
break again or am I just missing something basic?
How does one make bool tests work ?
Cheers and thanks,
Stephen Davies
========================================================================
Stephen Davies Consulting scldad@sdc.com.au
Adelaide, South Australia. Voice: 08-8177 1595
Computing & Network solutions. Fax: 08-8177 0133
^ permalink raw reply [nested|flat] 4+ messages in thread
* re:ODBC handling of bools?
@ 2000-12-18 23:21 Stephen Davies <scldad@sdc.com.au>
0 siblings, 0 replies; 4+ messages in thread
From: Stephen Davies @ 2000-12-18 23:21 UTC (permalink / raw)
To: pgsql-interfaces
Thanks to those who replied to my earlier posting.
The "Bools as Char" option _was_ the immediate fix. What I had
forgotten was that I was using Access as "middleware" and that you have
to delete and relink the Access table for the driver change to take effect.
(The app involved was originally written for Access and then migrated to
Postgresql)
My queries now work but the problem now, however, is that the bound
checkboxes associated with the bools now give "type mismatch" errors
(which they didn't before I changed the driver opton)
Cheers and thanks,
Stephen Davies
========================================================================
Stephen Davies Consulting scldad@sdc.com.au
Adelaide, South Australia. Voice: 08-8177 1595
Computing & Network solutions. Fax: 08-8177 0133
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2000-12-18 23:21 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2000-12-17 09:35 ODBC handling of bools? Stephen Davies <scldad@sdc.com.au>
2000-12-18 13:39 ` Francis Solomon <francis@stellison.co.uk>
2000-12-17 15:41 RE: ODBC handling of bools? Michael Davis <mdavis@sevainc.com>
2000-12-18 23:21 re:ODBC handling of bools? Stephen Davies <scldad@sdc.com.au>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox