Skip site navigation (1) Skip section navigation (2)

Re: Various errors in psqlodbc: SQLGetTypeInfo, SQLTables, bigint, and double vs float

From: Adrien de Croy <adrien(at)qbik(dot)com>
To: Hiroshi Inoue <inoue(at)tpf(dot)co(dot)jp>
Cc: "pgsql-odbc(at)postgresql(dot)org" <pgsql-odbc(at)postgresql(dot)org>
Subject: Re: Various errors in psqlodbc: SQLGetTypeInfo, SQLTables, bigint, and double vs float
Date: 2010-11-03 10:13:41
Message-ID: 4CD135D5.1090308@qbik.com (view raw or flat)
Thread:
Lists: pgsql-odbc
  Hi

On 3/11/2010 9:36 p.m., Hiroshi Inoue wrote:
> Hi,
>
> (2010/11/03 12:22), Adrien de Croy wrote: 5. Oddness with double 
> precision fields.
>>
>> We had to use double precision fields to store file size information,
>> because bigint couldn't do an __int64 (not sure what actual C type this
>> really maps to in reality). However when we get the field data back in a
>> query, it is reported as type SQL_FLOAT, even though the DB structure in
>> the PostgreSQL manager shows it as double precision. Obviously you don't
>> want to truncate double to float, so is this just in the driver (some
>> type switch case not supported?)
>
> SQL_FLOAT means double precision type. What means signle precision type
> is SQL_REAL.

When I tried to store a C double type (8byte floating point) into this 
field which reported itself as SQL_FLOAT even though it's "double 
precision", it reported that the thing I was poking in was too big, so I 
had to fall back to storing it as a C float type.  This is using 
SQLBindParameter.

my understanding is SQL_DOUBLE is required.   Is that used?  It's 
certainly used by other DBs, such as MySQL, MS SQL server and Access even.

Thanks for your reply

Regards

Adrien

>
>> Once we worked around all these issues, it seems to be working great.
>> I'm a bit concerned about losing precision with double vs float though.
>>
>> Regards
>>
>> Adrien
>

-- 
Adrien de Croy - WinGate Proxy Server - http://www.wingate.com


In response to

pgsql-odbc by date

Next:From: Marie-Claude QUIDOZDate: 2010-11-03 13:01:28
Subject: i have problem with psqlodbc_09_00_0200.zip
Previous:From: Hiroshi InoueDate: 2010-11-03 08:36:39
Subject: Re: Various errors in psqlodbc: SQLGetTypeInfo, SQLTables, bigint, and double vs float

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group