RudziankoŇ≠ RudziankoŇ≠ - 4 months ago 23
SQL Question

How does view synchronizes with the table

Assume I created

updatable view
:

CREATE VIEW OFFICEINFO AS
SELECT OFFICE, CITY, REGION
FROM OFFICES


Questions:


  1. Will my
    OFFICEINFO
    reflect changes if I insert new value to
    OFFICES
    ?

  2. How does synchronization work. Is there any predefined triggers on
    OFFICES
    table?

  3. Can I switch off synchronization?

  4. What is "pro" and "contro" of having synchronization between
    view
    and
    table
    ?


Answer

For an oracle DB, a quick glimpse:

  1. Yes

  2. No Triggers, you can imagine a view as a pointer to the table. It reflects the data in table in real time, if juss store the query

  3. No, but you can use a materialized view.

  4. Pro, you can use the view as an aggregator from table/s data , but it does not occupy space in database, cons: if you change table/s structure the view will become invalid until recompilation