For a table with fields 'fname' and 'lname', I created a view with a field 'name' which was a concat of 'fname' and 'lname'.
I want to insert into this view such that the string 'firstname lastname' is inserted into field 'name' of this view and automatically updated as 'firstname' and 'lastname' in fields 'fname' and 'lname' of the parent table.
create view emp_view as
-> select id,concat(fname,' ', lname) as name, email
-> from employee;
insert into emp_view
-> values(1911,'xyz abc','[email protected]');
ERROR 1471 (HY000): The target table emp_view of the INSERT is not insertable-into
But the error says that the view is not insertable. what am i doing wrong?