X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id EC5B63A40BB for ; Wed, 19 Jan 2005 12:17:06 +0000 (GMT) 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 76556-07 for ; Wed, 19 Jan 2005 12:16:51 +0000 (GMT) Received: from anchor-post-30.mail.demon.net (anchor-post-30.mail.demon.net [194.217.242.88]) by svr1.postgresql.org (Postfix) with ESMTP id 6D7A53A40AD for ; Wed, 19 Jan 2005 12:16:53 +0000 (GMT) Received: from mwynhau.demon.co.uk ([193.237.186.96] helo=mainbox.archonet.com) by anchor-post-30.mail.demon.net with esmtp (Exim 4.42) id 1CrElY-000PWb-0L; Wed, 19 Jan 2005 12:16:52 +0000 Received: from [192.168.1.17] (client17.archonet.com [192.168.1.17]) by mainbox.archonet.com (Postfix) with ESMTP id 3C7D5166F7; Wed, 19 Jan 2005 12:16:51 +0000 (GMT) Message-ID: <41EE4FB2.9080307@archonet.com> Date: Wed, 19 Jan 2005 12:16:50 +0000 From: Richard Huxton User-Agent: Mozilla Thunderbird 1.0 (X11/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: =?ISO-8859-1?Q?K=D6PFERL_Robert?= Cc: pgsql-sql@postgresql.org Subject: Re: Returning a bool on DELETE in a proc. References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.073 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200501/143 X-Sequence-Number: 19931 KÖPFERL Robert wrote: > Thanks, but that was not what I was looking for. > > Seems that I forgot to mention that this function is intended to be written > in SQL, not in PL/SQL. For the second one I already picked it off the > fascinating* doc (as Keith did) that GET DIAGONSTIC is the right thing. > > So what variable/function is the correct SQL-equivalent to ROW_COUNT and can > it be used in the following statement ? > like DELETE...; SELECT (ROW_COUNT<>0); to return a bool value? SQL doesn't support that (although I suppose it could be made to with some pg_rows_affected() function). You'll need to use plpgsql (or similar) if you want a result status returned. -- Richard Huxton Archonet Ltd