开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜