From: Shane McEneaney <shane@shadowbox.ie>
To: pgsql-sql@postgresql.org
Subject: How to Return number of rows updated in stored procedure
Date: Wed, 25 Oct 2000 17:03:50 +0100
Message-ID: <019801c03e9d$2a810520$49dc7ac0@gamesnow.ie> (raw)
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!!!
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: shane@shadowbox.ie
Subject: Re: How to Return number of rows updated in stored procedure
In-Reply-To: <019801c03e9d$2a810520$49dc7ac0@gamesnow.ie>
References: <019801c03e9d$2a810520$49dc7ac0@gamesnow.ie>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox