Re: Equivalent to sql%rowcount or @@rowcount

From: Richard Huxton <dev(at)archonet(dot)com>
To: "vijaykumar M" <m_vijaykumar(at)hotmail(dot)com>, pgsql-sql(at)postgresql(dot)org
Subject: Re: Equivalent to sql%rowcount or @@rowcount
Date: 2003-07-25 08:05:21
Message-ID: 200307250905.21817.dev@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Friday 25 July 2003 07:04, vijaykumar M wrote:
> Hi All!
> is it possible to get in sql number of rows affected by the sql last insert,
>
> update or delete statement??
>
> for eg,
>
> oracle ------------- sql%rowcount.
> sqlserver ------------ select @@rowcount.

You can do this sort of thing inside a plpgsql function - see ch 19.5.5
"Obtaining result status" in the programmers manual.

GET DIAGNOSTICS my_var = ROW_COUNT;

Oh - and _please_ don't post html-only messages to the list.

--
Richard Huxton
Archonet Ltd

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message ries 2003-07-25 08:18:18 [OT] Frontend recommendations
Previous Message vijaykumar M 2003-07-25 06:04:55 Equivalent to sql%rowcount or @@rowcount