Re: select count(*) datatype ?

From: lothar(dot)behrens(at)lollisoft(dot)de
To: pgsql-odbc(at)postgresql(dot)org
Subject: Re: select count(*) datatype ?
Date: 2005-10-01 08:30:56
Message-ID: 433E6560.14220.6D253B@localhost
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

Am 30 Sep 2005 um 17:57 hat lothar(dot)behrens(at)lollisoft(dot)de geschrieben:

I have solved that problem. Open Watcom has a function atoll and lltoa for long
long conversion. I'll try this on Linux and Mac later, there may be similar functions.

Lothar

> Am 30 Sep 2005 um 9:54 hat Tom Lane geschrieben:
>
> > lothar(dot)behrens(at)lollisoft(dot)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
>
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: explain analyze is your friend
>

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

In response to

Browse pgsql-odbc by date

  From Date Subject
Next Message Zlatko Matić 2005-10-02 23:14:57 Unbound text box, Text > 255 characters, MSAccess/PostgreSQL
Previous Message Hajo Kirchhoff 2005-10-01 07:45:38 Re: postgresql-odbc vs. unixODBC