Re: newbie libpq question...

Lists: pgsql-interfaces
From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Doug Homoelle <homoelle(at)ll(dot)mit(dot)edu>
Cc: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: newbie libpq question...
Date: 2004-11-08 23:17:31
Message-ID: 11698.1099955851@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-interfaces

Doug Homoelle <homoelle(at)ll(dot)mit(dot)edu> writes:
> res = PQexec(conn, "select blah blah blah");
> test_int=PQntuples(res);
> fprintf(stdout,"number of rows: %f\n",test_int);
> test_int=PQnfields(res);
> fprintf(stdout,"number of cols: %f\n",test_int);

If test_int is an integer, you want %d or %i in the format, not %f ...

regards, tom lane


From: "Jeroen T(dot) Vermeulen" <jtv(at)xs4all(dot)nl>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Doug Homoelle <homoelle(at)ll(dot)mit(dot)edu>, pgsql-interfaces(at)postgresql(dot)org
Subject: Re: newbie libpq question...
Date: 2004-11-09 14:32:14
Message-ID: 20041109143213.GA36682@xs4all.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-interfaces

On Mon, Nov 08, 2004 at 06:17:31PM -0500, Tom Lane wrote:
> Doug Homoelle <homoelle(at)ll(dot)mit(dot)edu> writes:

> If test_int is an integer, you want %d or %i in the format, not %f ...

Plus, the singular for "criteria" is "criterion." :-P