sqloracleview

How to update a view in oracle


I have create view without any problem in Oracle. But I can not update it.I want update view in oracle, please help. Is it possible anyway?


Solution

  • You can create an instead of trigger on the view, as described in the documentation:

    A view presents the output of a query as a table. If you want to change a view as you would change a table, you must create INSTEAD OF triggers. Instead of changing the view, they change the underlying tables.

    Once you have that trigger in place, you can update the view using the same syntax as if it was a table.

    You haven't shown your view or table definitions so there isn't enough information to provide a useful example; fortunately the documentation has one you can use as a starting point.