开发者

Update the record which is being inserted/updated using a trigger

开发者 https://www.devze.com 2023-02-09 18:49 出处:网络
How can I update a full name as the c开发者_StackOverflow中文版ombination of the first name and last name of the same record which is being updated/inserted using a trigger?CREATE OR REPLACE TRIGGER u

How can I update a full name as the c开发者_StackOverflow中文版ombination of the first name and last name of the same record which is being updated/inserted using a trigger?


CREATE OR REPLACE TRIGGER updateFullName
BEFORE INSERT OR UPDATE ON table
FOR EACH ROW
BEGIN
  :NEW.full_name := :NEW.first_name || ' ' || :NEW.last_name;
END;
/

Though a view would probably be more appropriate in this case

0

精彩评论

暂无评论...
验证码 换一张
取 消