Search
 
SCRIPT & CODE EXAMPLE
 

SQL

trigger in postgresql to change incoming entry

CREATE or REPLACE FUNCTION func()
RETURNS TRIGGER
AS $$
BEGIN
NEW.columnname = 0;
RETURN NEW;
END;
$$
LANGUAGE plpgsql;

-- Statement to make trigger to execute above code --
CREATE TRIGGER change_incoming BEFORE INSERT on Tablename 
FOR EACH ROW EXECUTE PROCEDURE func();
Comment

PREVIOUS NEXT
Code Example
Sql :: oracle plsql sleep 
Sql :: select table column name in sql 
Sql :: mysql current date 
Sql :: postgresql alter table sequence 
Sql :: check if table exists oracle 
Sql :: how to delete a record from sqlite in android 
Sql :: sql check double value 
Sql :: sql server substring 
Sql :: mysql update row 
Sql :: mysql show attributes of a table 
Sql :: mysql add column 
Sql :: sql server query all database objects 
Sql :: allow external access to mysql 
Sql :: sql first character 
Sql :: sql count group by 
Sql :: oracle sql date get month 
Sql :: sql identity column reset 
Sql :: mysql select multiple rows into one column 
Sql :: how to get the date diff on once field in sql server 
Sql :: sql cheat sheet pdf 
Sql :: how to find database collation in postgres 
Sql :: datediff in sql server 
Sql :: sql create schema 
Sql :: sql waitfor 
Sql :: avg mysql 
Sql :: select where duplicate mysql 
Sql :: mysql compare datetime to another datetime 
Sql :: sql current date 
Sql :: phone no data type in sql server 
Sql :: sql sum by column 
ADD CONTENT
Topic
Content
Source link
Name
2+3 =