PsqlODBC and SQLDescribeCol - Mailing list pgsql-general

From Andy Hallam
Subject PsqlODBC and SQLDescribeCol
Date
Msg-id 9rjv9e$iu3$1@news.tht.net
Whole thread Raw
List pgsql-general
PostgreSQL - 7.1.3  (installed on Linux 2.4.2-2)
PSQLODBC.DLL - 07.01.0007
Visual C++ - 6.0


SQLDescribeCol() does not return the correct meta data results.

The seventh argument to SQLDescribeCol - SQLUINTEGER *ColumnSizePtr - should
return the size of the column.

Here is a snap-shot of the documentation :-

  ColumnSizePtr
  [Output]
  Pointer to a buffer in which to return the size of the column on the data
source. If the column size cannot be determined, the driver returns 0. For
more information on column size, see "Column Size, Decimal Digits, Transfer
Octet Length, and Display Size" in Appendix D: Data Types.

SQLDescribeCol works fine under SQLSERVER, DB2 and ORACLE. i.e using the
below schema I get 20 returned in ColumnSizePtr, but, under PostgreSQL I get
254 ??? - Also, I get 254 no matter what size I make mytable.mycolumn

CREATE TABLE mytable
(
 mycolumn NCHAR VARYING (20)
)


If I change the mytable.mycolumn data type from NCHAR VARYING (20) ->
CHARACTER (20) ColumnSizePtr returns 3. !!!

Anyone come across this before?

Andy
ahm@exel.co.uk




pgsql-general by date:

Previous
From: Chris Green
Date:
Subject: bug in interval/extract or am I abusing interval()?
Next
From: Antonio Sergio de Mello e Souza
Date:
Subject: Re: pgadmin2