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 BBD803A1AB4 for ; Tue, 18 Jan 2005 16:05:24 +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 31900-02 for ; Tue, 18 Jan 2005 16:05:13 +0000 (GMT) Received: from mx-00.sil.at (mx-00.sil.at [62.116.68.196]) by svr1.postgresql.org (Postfix) with ESMTP id C820A3A1AE0 for ; Tue, 18 Jan 2005 16:05:10 +0000 (GMT) Received: (qmail-ldap/ctrl 15616 invoked from network); 18 Jan 2005 16:04:57 -0000 Received: from unknown (HELO jupiter.sonorys.at) ([213.235.243.42]) (envelope-sender ) by mx-00.sil.at (qmail-ldap-1.03) with SMTP for ; 18 Jan 2005 16:04:57 -0000 Received: from neptun.sonorys.at (neptun.sonorys.at [172.24.1.17]) by jupiter.sonorys.at (8.11.7+Sun/8.11.7) with ESMTP id j0IG58s02947 for ; Tue, 18 Jan 2005 17:05:09 +0100 (MET) Received: by neptun.sonorys.at with Internet Mail Service (5.5.2653.19) id ; Tue, 18 Jan 2005 17:04:58 +0100 Message-ID: From: =?ISO-8859-1?Q?K=D6PFERL_Robert?= To: Cc: pgsql-sql@postgresql.org Subject: Returning a bool on DELETE in a proc. Date: Tue, 18 Jan 2005 17:04:58 +0100 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain; charset="ISO-8859-1" X-Virus-Scanned: by amavisd-new at hub.org X-Archive-Number: 200501/132 X-Sequence-Number: 19920 Hi, I'm currently writing a function which encapsulates a delete and should return a bool as indicator for success. I tried: DELETE FROM "TariffDetails" WHERE "TariffId"=$1 and "BNumberPrefix"=$2; SELECT TRUE; but this makes me not happy. How can I distingruish wehter DELETE affected 0 or more rows and return that while DELETE is not capable of returning any value? And is the whole function executed if the DELETE fails or will it stop bevore the select? I had a read throu SQL-functions while nothing matched me.