Skip to Content.
Sympa Menu

freetds - Re: [freetds] db-lib DBNUMERIC structure

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: jklowden AT schemamania.org
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] db-lib DBNUMERIC structure
  • Date: Mon, 12 Sep 2011 10:21:56 -0400

On Mon, Sep 12, 2011 at 01:11:01PM +0200, LacaK wrote:
> 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.

Just to remind you, you could just bind the type to DBFLT4 or DBFLT8
(FLT4BIND or FLT8BIND). Or use dbconvert().

If you want the sausage-factory details, cf. tds_convert() source code.

--jkl




Archive powered by MHonArc 2.6.24.

Top of Page