Received: from hub.org.org (localhost [127.0.0.1]) by hub.org (8.10.1/8.11.0) with SMTP id e9PMlL690157 for ; Wed, 25 Oct 2000 18:47:26 -0400 (EDT) (envelope-from pgsql-sql-owner@hub.org) Received: from quay.quay.ie (quay.quay.ie [192.122.220.1]) by hub.org (8.10.1/8.11.0) with ESMTP id e9PG39O96395 for ; Wed, 25 Oct 2000 12:03:10 -0400 (EDT) (envelope-from shane@shadowbox.ie) Received: from shane (sega2.quay.ie [192.122.220.73]) by quay.quay.ie (8.9.1b+Sun/8.9.1/891-POC) with SMTP id RAA05182 for ; Wed, 25 Oct 2000 17:02:57 +0100 (BST) Message-ID: <019801c03e9d$2a810520$49dc7ac0@gamesnow.ie> Reply-To: "Shane McEneaney" From: "Shane McEneaney" To: Subject: How to Return number of rows updated in stored procedure Date: Wed, 25 Oct 2000 17:03:50 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 X-Archive-Number: 200010/227 X-Sequence-Number: 1894 Hi, can anybody tell me how to capture the number of rows updated in an update query inside a stored procedure? This doesn't work but hopefully you will see what I mean. CREATE FUNCTION "test" () RETURNS int AS ' DECLARE v_number_of_rows int; BEGIN select into v_number_of_rows update carbon_user set email_confirmed = ''Y'' where email_confirmed = ''Y''; RETURN v_myvar; END; ' LANGUAGE 'plpgsql'; Thanks in advance!!!