Update the record which is being inserted/updated using a trigger
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
精彩评论