Re: newbie libpq question...

From: "D'Arcy J(dot)M(dot) Cain" <darcy(at)druid(dot)net>
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:21:55
Message-ID: 20041108182155.086d9d58.darcy@druid.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

On Mon, 08 Nov 2004 17:36:09 -0500
Doug Homoelle <homoelle(at)ll(dot)mit(dot)edu> wrote:
> I'm trying to use the libpq library for the first time and I'm
> experiencing what seems to be a very basic problem. When I run the
> following:
>
> 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);
>
> where "blah blah blah" is the selection criteria, I get zero rows and

I think you need "number of cols: %d\n" there. Those functions returns
int.

--
D'Arcy J.M. Cain <darcy(at)druid(dot)net> | Democracy is three wolves
http://www.druid.net/darcy/ | and a sheep voting on
+1 416 425 1212 (DoD#0082) (eNTP) | what's for dinner.

Responses

Browse pgsql-interfaces by date

  From Date Subject
Next Message Gaetano Sferra 2004-11-09 11:39:57 ecpg: using cursor returned from a stored function
Previous Message Tom Lane 2004-11-08 23:17:31 Re: newbie libpq question...