Is there any way to insert data into multiple tables through a view in mysql?
+2
A:
The MySQL Reference Manual says this about updatable views:
Some views are updatable. That is, you can use them in statements such as
UPDATE
,DELETE
, orINSERT
to update the contents of the underlying table. For a view to be updatable, there must be a one-to-one relationship between the rows in the view and the rows in the underlying table. There are also certain other constructs that make a view nonupdatable.The
WITH CHECK OPTION
clause can be given for an updatable view to prevent inserts or updates to rows except those for which theWHERE
clause in the select_statement is true. TheWITH CHECK OPTION
clause was implemented in MySQL 5.0.2.
You can find the entire article here.
Marc Ripley
2010-05-27 07:46:41