Skip to Content.
Sympa Menu

freetds - [freetds] db-lib DBNUMERIC structure

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: LacaK <lacak AT zoznam.sk>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: [freetds] db-lib DBNUMERIC structure
  • Date: Mon, 12 Sep 2011 13:11:01 +0200

Hi,
there is sybdb.h

typedef struct dbnumeric
{
char precision;
char scale;
unsigned char val[MAXNUMLEN];
} DBNUMERIC;

for retrieving exact numeric data.

But I can not find, how to interpret/read "val" array to construct number.

I found article from Microsoft db-lib: http://support.microsoft.com/kb/222831
But it seems, that Microsoft start from index 0 from low significant values to high significant.

In case of FreeTDS it seems, that order is reversed and somehow shifted (based on precision).

Can somebody explain how to correctly construct value ?

Thanks
-Laco.






Archive powered by MHonArc 2.6.24.

Top of Page