pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: lothar.behrens@lollisoft.de
To: pgsql-odbc@postgresql.org
Subject: Re: select count(*) datatype ?
Date: Fri, 30 Sep 2005 17:57:51 +0200
Message-ID: <433D7C9F.19166.1ECB6C5@localhost> (raw)
In-Reply-To: <20334.1128088493@sss.pgh.pa.us>
References: <433D3798.1250.DF1725@localhost>

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






view thread (4+ messages)  latest in thread

Message-ID: <433D7C9F.19166.1ECB6C5@localhost>
Permalink:  ../433D7C9F.19166.1ECB6C5@localhost/
Also on:    postgresql.org/message-id/433D7C9F.19166.1ECB6C5@localhost

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-odbc@postgresql.org
  Cc: lothar.behrens@lollisoft.de
  Subject: Re: select count(*) datatype ?
  In-Reply-To: <433D7C9F.19166.1ECB6C5@localhost>
  References: <433D3798.1250.DF1725@localhost> <433D7C9F.19166.1ECB6C5@localhost>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox