Home > OS >  use MySQL trigger for updating tables of a view
use MySQL trigger for updating tables of a view

Time:12-16

I have a view using "Union", so not updatable. For practical reasons, it would be really nice to be able to send insert/update/delete queries on this view. (everything is old and there are too many things and as always no time and money to redo everything)

Is it possible to use trigger for intercept update/insert/delete, change the table name of the original query to the target table, execute the query on the target table and not do it on the view?

CodePudding user response:

It's not possible. The CREATE VIEW documentation specifically says:

You cannot associate a trigger with a TEMPORARY table or a view.

  • Related