Received: from clubserv.rp-online.de (clubserv.rp-online.de [149.221.232.11]) by hub.org (8.9.2/8.9.1) with ESMTP id CAA41090 for ; Mon, 8 Mar 1999 02:45:51 -0500 (EST) (envelope-from Michael.Meskes@gmx.net) Received: from pc63.meskes.de (as11-asy100.rp-plus.de [149.221.93.228]) by clubserv.rp-online.de (8.9.1a/8.9.1) with ESMTP id IAA00380 for ; Mon, 8 Mar 1999 08:45:39 +0100 (MET) Received: (from meskes@localhost) by pc63.meskes.de (8.9.3/8.9.0/Debian/GNU) id IAA00307 for pgsql-interfaces@postgresql.org; Mon, 8 Mar 1999 08:46:47 +0100 Date: Mon, 8 Mar 1999 08:46:47 +0100 From: Michael Meskes To: pgsql-interfaces@postgresql.org Subject: Re: [INTERFACES] Counting updates with libpq Message-ID: <19990308084647.C227@gmx.net> Mail-Followup-To: pgsql-interfaces@postgresql.org References: <19990306135432.A1858@gmx.net> <21236.920823639@sss.pgh.pa.us> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.3i In-Reply-To: <21236.920823639@sss.pgh.pa.us>; from Tom Lane on Sun, Mar 07, 1999 at 11:20:39AM -0500 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!