X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 3C06A52D29 for ; Fri, 19 Aug 2005 03:32:51 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 67686-01 for ; Fri, 19 Aug 2005 06:32:47 +0000 (GMT) Received: from wukifi.ugyvitelszolgaltato.hu (adsl215141.vnet.hu [62.77.215.141]) by svr1.postgresql.org (Postfix) with SMTP id 4546D52D18 for ; Fri, 19 Aug 2005 03:32:45 -0300 (ADT) Received: (qmail 18846 invoked from network); 19 Aug 2005 05:35:59 -0000 Received: from unknown (HELO daq) (193.80.82.4) by 193.80.82.16 with SMTP; 19 Aug 2005 05:35:59 -0000 Date: Fri, 19 Aug 2005 08:32:43 +0200 From: daq X-Mailer: The Bat! (v1.53d) Business Reply-To: daq16 X-Priority: 3 (Normal) Message-ID: <150680430859.20050819083243@ugyvitelszolgaltato.hu> To: "Marc G. Fournier" Cc: Pgsql-sql@postgresql.org Subject: Re: pl/PgSQL: Samples doing UPDATEs ... In-Reply-To: <20050819023618.K1002@ganymede.hub.org> References: <20050819023618.K1002@ganymede.hub.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=1.892 required=5 tests=[AWL=0.026, FORGED_RCVD_HELO=0.05, RCVD_BY_IP=0.024, RCVD_IN_NJABL_DUL=1.655, RCVD_IN_SORBS_DUL=0.137] X-Spam-Level: * X-Archive-Number: 200508/166 X-Sequence-Number: 22394 MGF> I have an older PostgreSQL book here, that has chapter on pl/PgSQL in it, MGF> but no good samples .... MGF> What I'm looking for is a sample of a function that returns # of rows MGF> updated, so that I can make a decision based on that ... does anyone know MGF> where I could find such (and others, would be great) online? ... execute ''Update ...''; GET DIAGNOSTICS processed_rows = ROW_COUNT; return processed_roows; ... See PostgreSQL 7.3 online documentation 19.5.5. Obtaining result status. http://www.postgresql.org/docs/7.3/interactive/plpgsql-statements.html DAQ