X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 1F1E1D1C4D0 for ; Fri, 25 Jul 2003 08:05:26 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 16549-05 for ; Fri, 25 Jul 2003 05:04:40 -0300 (ADT) Received: from anchor-post-39.mail.demon.net (anchor-post-39.mail.demon.net [194.217.242.80]) by svr1.postgresql.org (Postfix) with ESMTP id 4FDF8D1C4CD for ; Fri, 25 Jul 2003 05:05:24 -0300 (ADT) Received: from mwynhau.demon.co.uk ([193.237.186.96] helo=mainbox.archonet.com) by anchor-post-39.mail.demon.net with esmtp (Exim 3.36 #2) id 19fxZt-000598-0U; Fri, 25 Jul 2003 09:05:25 +0100 Received: from localhost (localhost.localdomain [127.0.0.1]) by mainbox.archonet.com (Postfix) with ESMTP id 65572173E3; Fri, 25 Jul 2003 09:05:23 +0100 (BST) Received: from client.archonet.com (client.archonet.com [192.168.1.16]) by mainbox.archonet.com (Postfix) with ESMTP id B6CC1173E2; Fri, 25 Jul 2003 09:05:22 +0100 (BST) From: Richard Huxton To: "vijaykumar M" , pgsql-sql@postgresql.org Subject: Re: Equivalent to sql%rowcount or @@rowcount Date: Fri, 25 Jul 2003 09:05:21 +0100 User-Agent: KMail/1.5 References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200307250905.21817.dev@archonet.com> X-Virus-Scanned: by AMaViS snapshot-20020531 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/370 X-Sequence-Number: 14484 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