Re: select count(*) datatype ? - Mailing list pgsql-odbc

From lothar.behrens@lollisoft.de
Subject Re: select count(*) datatype ?
Date
Msg-id 433D7C9F.19166.1ECB6C5@localhost
Whole thread Raw
In response to Re: select count(*) datatype ?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: select count(*) datatype ?
List pgsql-odbc
Am 30 Sep 2005 um 9:54 hat Tom Lane geschrieben:

> lothar.behrens@lollisoft.de writes:
> > what type of column is an aggregated value of count ?
>
> bigint, at least in recent PG releases.
>
>             regards, tom lane
>

Thanks,

but now I am a little confused about how to convert those datatypes to a char[] type.

I write long datatypes from char[] array into bound buffer:

long l = 0;
l = atol("long value");
long* pl = (long*) buffer;
void* b = pl+1;
memcpy(b, &l, sizeof(l));

I read long datatypes into char[] array from bound buffer:

char charrep[100] = "";
sprintf(charrep, "%d", *(long*) buffer);
result->setData(charrep);

How do I this for bigint datatypes (long long as I think) ?

Thanks

Lothar

--
Lothar Behrens    |    Rapid Prototyping ...
Rosmarinstr 3        |
40235 Düsseldorf      |    www.lollisoft.de




pgsql-odbc by date:

Previous
From: "Chris Ingram"
Date:
Subject: Integrity constraint violation should set SQLSTATE to 23000
Next
From: "Dave Page"
Date:
Subject: Re: Integrity constraint violation should set SQLSTATE to 23000