Received: from quay.quay.ie (quay.quay.ie [192.122.220.1]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id eAKF9Rs21747 for ; Mon, 20 Nov 2000 10:09:27 -0500 (EST) (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 PAA19345 for ; Mon, 20 Nov 2000 15:07:24 GMT Message-ID: <008701c05303$d1f51100$49dc7ac0@gamesnow.ie> Reply-To: "Shane McEneaney" From: "Shane McEneaney" To: Subject: Return number of rows update in query Date: Mon, 20 Nov 2000 15:08:06 -0000 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: 200011/154 X-Sequence-Number: 185 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!!! Shane