Answers for "how to make an update statement a stored procedure psql"

SQL
0

postgresql stored procedure update table values

CREATE OR REPLACE FUNCTION change_account_email(
  IN oldAddr VARCHAR(50),
  IN newAddr VARCHAR(50))
RETURNS INTEGER AS 
$$
DECLARE
  rcount INTEGER DEFAULT 0;
BEGIN
  UPDATE accounts
     SET a_email = newAddr
   WHERE a_email = oldAddr;
   GET DIAGNOSTICS rcount = ROW_COUNT;
   RETURN rcount;
END;
$$
LANGUAGE plpgsql;
Posted by: Guest on August-14-2021

Code answers related to "how to make an update statement a stored procedure psql"

Code answers related to "SQL"

Browse Popular Code Answers by Language