I am trying to save data to a view but it shows me the following error:
Can not modify more than one base table through a join view 'bd_calidad.vista_novedades_plantilla'
The instruction that I am executing is the following:
INSERT INTO `bd_calidad`.`vista_novedades_plantilla` (
`plantilla` ,
`codigoNovedad` ,
`categoria` ,
`categoriaNombre` ,
`categoriaDescripcion` ,
`novedadNombre` ,
`novedadDescripcion` ,
`puntos` ,
`orden`
)
VALUES (
'7','1', '1','PROTOCOLO','PROTOCOLO', 'SALUDO','SALUDO', '0', '1'
)
I have searched the internet for my problem but I still can't find a solution, I hope you can help me
A view is a virtual table (that is, it does not exist) that is defined by a query, therefore you cannot insert. More info .
Therefore you must know how this view is created, for example suppose it is only a join in two tables: TableA and TableB but we only take the attribute attrA1 from TableA and attrB2 from TableB
We would have the following query:
As you can see, for your insert to be displayed in the view, you will have to insert data in both tables and that these coincide in the id so that the view shows them when doing a select from the view.