开发者

Create oracle trigger that will update a new column with the concatenated values of the updated columns

开发者 https://www.devze.com 2023-01-05 11:54 出处:网络
I have firstName, lastName and fullName columns in oracle. I want to be able to create a trigger that updates the fullName column with the firstName and lastName values when they are either updated or

I have firstName, lastName and fullName columns in oracle. I want to be able to create a trigger that updates the fullName column with the firstName and lastName values when they are either updated or inser开发者_如何学Cted. I would think this would be possible to do in oracle. Does anyone have any ideas. Thanks very much.



  create or replace trigger pick_a_name
   before insert or update
   on mytable
   for each row
 begin
    :new.full_name := :new.firstName ||' '|| :new.lastName;
 end pick_a_name;
0

精彩评论

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