Re: getting back autonumber ... Another MsSQL Comparation Question

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: "jimmy(dot)olsen" <jimmy(dot)olsen(at)ig(dot)com(dot)br>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: getting back autonumber ... Another MsSQL Comparation Question
Date: 2005-07-08 12:32:30
Message-ID: 20050708123230.GA60834@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

[Please start a new thread when asking new questions.]

On Fri, Jul 08, 2005 at 08:56:56AM -0300, jimmy.olsen wrote:
> I need to know the number of affected (Inserted, deleted, updated)
> rows by a Query. In MsSQL I use SELECT @@ROWCOUNT, similar to SELECT
> @@IDENTITY. Is there any @@RowCount similar statement in PostGres??

Your client interface should have a function to get the row count.
In libpq, for example, you can call PQcmdTuples(); in PL/pgSQL you
can use GET DIAGNOSTICS. See the documentation for whatever interface
you're using.

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Bruno Wolff III 2005-07-08 13:27:46 Re: getting back autonumber just inserted
Previous Message jimmy.olsen 2005-07-08 11:56:56 Re: getting back autonumber ... Another MsSQL Comparation Question