You need to make your view updatable. See http://dev.mysql.com/doc/refman/5.6/en/view-updatability.html
In summary:
A view is updatable if there is a one-to-one relationship between the rows in the view and the rows in the base table that are going to be updated.
A view is insertable if it is updatable and the columns present in the base table but not named in the view have default values.
I think, the expression group_concat(customername SEPARATOR ' ||| ')
will break the one-to-one relationship. I.e. this expression could prevent your view to be updatable.
The expression GROUP BY product_id
will definitely break a one-to-one relationship between the view and the base table.
The other way around, when you update/insert on the base table, it will be reflected on the view depending one-to-one relationship. If there is such a relationship, the view will use a MERGE
algorithm and modifications in the base table will be reflected in the view. If there is no such a one-to-one relationship the used algorithm will be TEMPLATE
, that means, a temporary table will be created for the view. See http://dev.mysql.com/doc/refman/5.0/en/view-algorithms.html for view algorithms.