Обсуждение: ODBC interface question

Поиск
Список
Период
Сортировка

ODBC interface question

От
Jim Dickenson
Дата:
Your name: Jim Dickenson
Your email address: dickenson@ cfmc.com


System Configuration
---------------------
  Architecture (example: Intel Pentium)Intel Pentium

  Operating System (example: Linux 2.0.26 ELF): Red Hat Linux 7.1

  PostgreSQL version (example: PostgreSQL-7.0):   PostgreSQL-7.0.3

  Compiler used (example:  gcc 2.8.0): gcc 2.96


Please enter a FULL description of your problem:
------------------------------------------------
When I call SQLDescribeCol() for a column that has been defined as
decimal(10,3) or numeric(10,3), as an example, I would expect
the values in ColumnSizePtr and DecimalDigitsPtr to be 10 and 3,
not 655363 and 0. Additionally I would expect DataTypePtr to be 2
and not 12.

I need to be able to find an accurate description for the attributes
of each column returned for a select statement. It seems to me that
SQLDescribeCol() should do that.



Please describe a way to repeat the problem.   Please try to provide a
concise reproducible example, if at all possible:
----------------------------------------------------------------------
Create a table in psql. Write an application that opens the database
containing the table. Call SQLPrepare with "select * from tabname". Call
SQLDescribeCol() to get the resulting meta data.




If you know how this problem might be fixed, list the solution below:
---------------------------------------------------------------------
It seems to me that in order for ODBC to work with different data sources
all ODBC drivers need to conform to a standard. If one driver returns one
set of values and another driver returns another set of values, for what I
think is the same basic table column, then the point of ODBC to be data
source neutral is lost.



Re: ODBC interface question

От
Hiroshi Inoue
Дата:
Jim Dickenson wrote:
>
> Your name: Jim Dickenson
> Your email address: dickenson@ cfmc.com
>
> System Configuration
> ---------------------
>   Architecture (example: Intel Pentium)Intel Pentium
>
>   Operating System (example: Linux 2.0.26 ELF): Red Hat Linux 7.1
>
>   PostgreSQL version (example: PostgreSQL-7.0):   PostgreSQL-7.0.3
>
>   Compiler used (example:  gcc 2.8.0): gcc 2.96
>
> Please enter a FULL description of your problem:
> ------------------------------------------------
> When I call SQLDescribeCol() for a column that has been defined as
> decimal(10,3) or numeric(10,3), as an example, I would expect
> the values in ColumnSizePtr and DecimalDigitsPtr to be 10 and 3,
> not 655363 and 0. Additionally I would expect DataTypePtr to be 2
> and not 12.

Hmm here I get
  ColumnSizePtr = 10
  DecimalDigitsPtr = 3
  DataTypePtr =2.
You seem be able to get the precise result using newer version
of psqlodbc driver.

regards,
Hiroshi Inoue