'select count...' returns SQL_VARCHAR?

Поиск
Список
Период
Сортировка
От Stelios Sfakianakis
Тема 'select count...' returns SQL_VARCHAR?
Дата
Msg-id 3D2EC5F0.9060504@ics.forth.gr
обсуждение исходный текст
Ответы Re: 'select count...' returns SQL_VARCHAR?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-odbc
Hello everyone,

I am using the PostgreSQL and its ODBC driver but there seems to be
some problem with the "select count(...)..." queries. Here is my
configuration:
  - FreeBSD 4.6
  - PostgreSQL 7.2.1
  - PostgreSQL odbc driver 7.2.1
  - Driver Manager: iodbc 3.0.5 (and also tested with unixODBC 2.2.1
  and their pgsql odbc driver)
  - OTL <http://members.fortunecity.com/skuchin/home.htm>

In my test case I just want to execute a simple "SELECT COUNT(*) FROM
test_tab" but the result is an OTL exception whenever I try to get the
count as an int. The error message is that the result of the query is
a VARCHAR and so I should use a char[] instead. (Indeed, extracting it
in a C string works and gives the correct result.)

I tried to track the error and I saw that inside the OTL the
SQLDescribeCol function is called for the specific query that returns
12 (SQL_VARCHAR) as the data type of the (single) 'count' column.

So is this a bug, a feature, or something else?
Do I miss something?

Best regards
Stelios Sfakianakis

--
"Right now, CORBA *is* the future of middleware. I'm not aware of any
other middleware that would come even close in portability, platform
support, features, performance, or multi-vendor support. It will be a
minimum of six or seven years before any other middleware platform
will be able to match that."
       --- Michi Henning in news:comp.object.corba, 28/06/2002



В списке pgsql-odbc по дате отправления:

Предыдущее
От: "Dave Page"
Дата:
Сообщение: Re: [PATCHES] UI patch (Was: ODBC Patch to prevent setting of KSQO on 7.3+ servers)
Следующее
От: Preston Lord
Дата:
Сообщение: MS Access ODBC for Linux?