views:

37

answers:

1

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 inserted. I would think this would be possible to do in oracle. Does anyone have any ideas. Thanks very much.

+3  A: 

  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;