1CREATE OR REPLACE FUNCTION change_account_email(
2 IN oldAddr VARCHAR(50),
3 IN newAddr VARCHAR(50))
4RETURNS INTEGER AS
5$$
6DECLARE
7 rcount INTEGER DEFAULT 0;
8BEGIN
9 UPDATE accounts
10 SET a_email = newAddr
11 WHERE a_email = oldAddr;
12 GET DIAGNOSTICS rcount = ROW_COUNT;
13 RETURN rcount;
14END;
15$$
16LANGUAGE plpgsql;
17