Skip site navigation (1) Skip section navigation (2)

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-09-30 15:57:51
Message-ID: 433D7C9F.19166.1ECB6C5@localhost (view raw, whole thread or download thread mbox)
Lists: pgsql-odbc
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


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);

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



Lothar Behrens	|	Rapid Prototyping ...
Rosmarinstr 3		|	
40235 Düsseldorf  	|

In response to


pgsql-odbc by date

Next:From: Dave PageDate: 2005-09-30 16:14:30
Subject: Re: Integrity constraint violation should set SQLSTATE to 23000
Previous:From: Chris IngramDate: 2005-09-30 15:30:21
Subject: Integrity constraint violation should set SQLSTATE to 23000

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group