Re: ODBC Error while selecting a numeric data field - Mailing list pgsql-general

From Hiroshi Inoue
Subject Re: ODBC Error while selecting a numeric data field
Date
Msg-id EKEJJICOHDIEMGPNIFIJOEMEIGAA.Inoue@tpf.co.jp
Whole thread Raw
In response to Re: ODBC Error while selecting a numeric data field  ("Tom Ince" <tom.ince@netzero.net>)
List pgsql-general
> -----Original Message-----
> From: Tom Ince
>
> Well, I have managed to get the ODBC SQL select call to work with the
> NUMERIC database type.
>
> In the Windows ODBC Help file there is a section called "Converting Data
> from SQL to C Data Types"
>
> In this section there is a chart which shows the default
> conversion for the
> SQL_NUMERIC data type to
> a C data type is SQL_C_CHAR.  So I made a stab and used that in my
> SQLBindCol statement and it worked!
>
> Here is my SQLBindCol statement that didn't work :
> rc = SQLBindCol ( hstmt, i+1, SQL_C_NUMERIC, &fields[i].variant.f_numeric,
> fields[i].size, &fields[i].length );
>
> and here is the one that now works :
> rc = SQLBindCol ( hstmt, i+1, SQL_C_CHAR, &fields[i].variant.f_char,
> fields[i].size, &fields[i].length );
>
> I am still a little curious as to why the original way did not work, if
> anyone can point that out to me it would be
> greatly appreciated...

SQL_C_NUMERIC is an ODBC3.X type.
Psqlodbc driver is ODBC2.50.

regards,
Hiroshi Inoue


pgsql-general by date:

Previous
From: Chris Albertson
Date:
Subject: Re: Pushing PostgreSQL to the Limit (urgent!)
Next
From: Tom Lane
Date:
Subject: Re: Backend died abnormally - postgresql 7.2.1-5