Answers for "create trigger syntax"

SQL
1

CREATE trigger SQL

-- Oracle DB Syntax
CREATE OR REPLACE TRIGGER {trigger_name} 
BEFORE | AFTER 
INSERT | UPDATE | DELETE 
ON {table_name}
(FOR EACH ROW) 
{operation to be executed}

-- for example
CREATE TRIGGER log_updates 
AFTER INSERT OR UPDATE ON Person
FOR EACH ROW 
INSERT INTO LogPerson(ts, IdPerson, surname)
VALUES(CURRENT_TIMESTAMP, NEW.id, NEW.surname);
Posted by: Guest on February-04-2021
0

create trigger syntax

CREATE TRIGGER schema_name.trigger_name
ON table_name
AFTER  INSERT,UPDATE,DELETE
AS
{sql_statements}
Posted by: Guest on January-29-2021

Code answers related to "SQL"

Browse Popular Code Answers by Language