Skip to Content.
Sympa Menu

freetds - Re: TDS 7.0 (cvs), float types, MS SQL 7

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Michael Suedkamp" <ms AT suedkm.franken.de>
  • To: freetds
  • Subject: Re: TDS 7.0 (cvs), float types, MS SQL 7
  • Date: Sat, 26 Feb 2000 9:26:44


Brian,

I should have tested a little more before posting. I cannot obtain values
like "1", "1.5", "2", "2.5". For some reason these kind of values I expect
in our database.
However, I can obtain values like "1.4","1.6", "2.2" etc. ???????

The field in MS SQL 7 is of the "real" type (4 byte).

I added this code to the value_as_string function in tdstest.c:

...
TDS_REAL theReal;
...
switch(type) {
...
case 109: // This value is reported for the column type
// for both real types.
// I know I have to handle the 8 byte type differently ...
memcpy(&theReal, value, 4);
sprintf(result, "%.6f", theReal);
break;
...
}

I fear I'm doing some very basic C programming error here (yes, I am C
newbie).

Michael




Archive powered by MHonArc 2.6.24.

Top of Page