a precision problem of the SQL_C_DOUBLE value in the PsqlODBC

From: "Hiroki Kataoka" <kataoka(at)interwiz(dot)koganei(dot)tokyo(dot)jp>
To: "Pgsql-Interfaces" <pgsql-interfaces(at)postgreSQL(dot)org>
Subject: a precision problem of the SQL_C_DOUBLE value in the PsqlODBC
Date: 1999-12-21 07:16:19
Message-ID: NDBBIKCHILNJOAAPDPKMEECOCAAA.kataoka@interwiz.koganei.tokyo.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

Hi all.

I have found a precision problem of the SQL_C_DOUBLE value in the PsqlODBC.

When the PsqlODBC send a SQL_C_DOUBLE value from the ODBC client application
to PostgreSQL server, the precision is missing.

=====
Hiroki Kataoka

Following is a patch to fix this problem.

*** src.v06-40-0007/convert.c Fri Apr 9 18:47:40 1999
--- src.v06-40-0007.test/./convert.c Thu Dec 16 11:51:00 1999
***************
*** 710,721 ****
break;

case SQL_C_DOUBLE:
! sprintf(param_string, "%f",
*((SDOUBLE *) buffer));
break;

case SQL_C_FLOAT:
! sprintf(param_string, "%f",
*((SFLOAT *) buffer));
break;

--- 710,721 ----
break;

case SQL_C_DOUBLE:
! sprintf(param_string, "%.16g",
*((SDOUBLE *) buffer));
break;

case SQL_C_FLOAT:
! sprintf(param_string, "%.7g",
*((SFLOAT *) buffer));
break;

Browse pgsql-interfaces by date

  From Date Subject
Next Message Hiroki Kataoka 1999-12-21 07:45:10 RE: ODBC and RDO
Previous Message Robert Hiltibidal 1999-12-20 19:47:03 ODBC and RDO