Search
 
SCRIPT & CODE EXAMPLE
 

SQL

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;
Comment

PREVIOUS NEXT
Code Example
Sql :: get last 50 rows sql 
Sql :: import sql in postgresql 
Sql :: sql server insert inner join 
Sql :: sql extract from mail 
Sql :: SQL server how to see user permissions on objects 
Sql :: mysql age by birthdate 
Sql :: como saber si tengo mysql instalado 
Sql :: how to check table name in current database sql 
Sql :: postgress connection refused 
Sql :: raiserror nowait sql server 
Sql :: sql value exists in column 
Sql :: mysql query with sql to get the next row 
Sql :: mysql delete rows 
Sql :: mysql count by month 
Sql :: create scalar function in sql server 
Sql :: oracle duration between timestamps 
Sql :: importing excel data into sql server 
Sql :: q operator in plsql 
Sql :: rename column name sql server 
Sql :: postgres integer to serial 
Sql :: inner join 
Sql :: limit offset sql server 
Sql :: sql server delete table 
Sql :: function in postgresql 
Sql :: mysql disable logging 
Sql :: sql create table with data 
Sql :: ORA-01090: shutdown in progress - connection is not permitted 
Sql :: sum mysql 
Sql :: oracle list primary key 
Sql :: pgadmin see indexes 
ADD CONTENT
Topic
Content
Source link
Name
6+8 =