Re: Getting number of affected row after performing update

From: Richard Huxton <dev(at)archonet(dot)com>
To: Yan Cheng Cheok <yccheok(at)yahoo(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Getting number of affected row after performing update
Date: 2010-02-19 08:42:06
Message-ID: 4B7E4EDE.5060502@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 19/02/10 05:42, Yan Cheng Cheok wrote:
>
> Of course, I get an error at line :
> IF @@ROWCOUNT=0 THEN
>
> May I know what is the correct PostgreSQL syntax for @@ROWCOUNT after update?

Best place for this sort of information is the manuals:

http://www.postgresql.org/docs/8.4/static/plpgsql-statements.html#PLPGSQL-STATEMENTS-DIAGNOSTICS

GET DIAGNOSTICS my_variable = ROWCOUNT;

--
Richard Huxton
Archonet Ltd

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message dipti shah 2010-02-19 08:42:39 Re: Not able to access schema functions and table...
Previous Message Guillaume Lelarge 2010-02-19 08:32:51 Re: Not able to access schema functions and table...