how use trigger in sql
CREATE TRIGGER Product_Details_tr
BEFORE INSERT ON Product_Details
FOR EACH ROW
SET NEW.User_ID = CURRENT_USER();
how use trigger in sql
CREATE TRIGGER Product_Details_tr
BEFORE INSERT ON Product_Details
FOR EACH ROW
SET NEW.User_ID = CURRENT_USER();
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);
SQL trigger
CREATE TRIGGER [schema_name.]trigger_name
ON table_name
{FOR | AFTER | INSTEAD OF} {[INSERT] [,] [UPDATE] [,] [DELETE]}
AS
{sql_statements}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us