Return number of rows update in query - Mailing list pgsql-sql

From Shane McEneaney
Subject Return number of rows update in query
Date
Msg-id 008701c05303$d1f51100$49dc7ac0@gamesnow.ie
Whole thread Raw
List pgsql-sql
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



pgsql-sql by date:

Previous
From: Bruno Boettcher
Date:
Subject: numeric conversions?
Next
From: Tom Lane
Date:
Subject: Re: Like seems to fail !