Re: [INTERFACES] Counting updates with libpq - Mailing list pgsql-interfaces

From Michael Meskes
Subject Re: [INTERFACES] Counting updates with libpq
Date
Msg-id 19990308084647.C227@gmx.net
Whole thread Raw
In response to Re: [INTERFACES] Counting updates with libpq  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [INTERFACES] Counting updates with libpq  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-interfaces
On Sun, Mar 07, 1999 at 11:20:39AM -0500, Tom Lane wrote:
> > For ecpg I've beed using PQntuples(). Is it the same function?
>
> No.  PQntuples() is the number of rows in the returned result.  It will
> always be zero if the SQL command was not SELECT (or FETCH).

I'm afraid this is incorrect. I tried it on an insert (via exec sql execute
immediate) and it got the correct result.

> PQcmdTuples() is just a dumb little function that looks at the command
> status string (the same thing psql prints at the end of a query) and
> pulls out the number that appears in "UPDATE n" or "DELETE n" or
> "INSERT oid n".  Since the questioner asked about updated records,
> I assumed that was the number he wanted.

I need this number as well.

Michael
--
Michael Meskes                         | Go SF 49ers!
Th.-Heuss-Str. 61, D-41812 Erkelenz    | Go Rhein Fire!
Tel.: (+49) 2431/72651                 | Use Debian GNU/Linux!
Email: Michael.Meskes@gmx.net          | Use PostgreSQL!

pgsql-interfaces by date:

Previous
From: Tom Lane
Date:
Subject: Re: [INTERFACES] copy command & null datetime
Next
From: Denis Sbragion
Date:
Subject: Re: [INTERFACES] outer joins