PsqlODBC and SQLDescribeCol

From: "Andy Hallam" <ahm(at)exel(dot)co(dot)uk>
To: pgsql-general(at)postgresql(dot)org
Subject: PsqlODBC and SQLDescribeCol
Date: 2001-10-29 16:13:19
Message-ID: 9rjv9e$iu3$1@news.tht.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)exel(dot)co(dot)uk

Browse pgsql-general by date

  From Date Subject
Next Message Nick 2001-10-29 16:32:09 PostgresSQL 7.x Oracle8 Comparison
Previous Message Johnson, Shaunn 2001-10-29 15:40:37 psql and HTML