View comprehension in Oracle 1. View overview view is actually a query SQL statement used to display relevant data in one or more tables or other views. The view uses the results of a query as a table. Therefore, the view can be viewed as a stored query or a virtual table. The view comes from the table, and the view itself is a query result, so I personally think there is no significance for modifying the view, and the view cannot be updated when the view is created, there are two options: (1) when selecting the item with check option, you must ensure that the operated data meets the predicate conditions defined by the view when performing the update insert delete operation on the view, that is, the WHERE clause condition in the view subquery (2) option with read only read-ONLY view. You cannot use this view to update the statement for creating the view www.2cto.com: create [or Replace] VIEW VIEW_NAME AS subquery [with check option] [with read only] Delete VIEW: drop view VIEW_NAME2. the storage of a view is different from that of a table. A view does not require storage space allocation and does not contain actual data. The view only defines a query. The data in the view is obtained from the base table, which is dynamically generated when the view is referenced. Because a view is based on other objects in the database, a view only needs to occupy the space defined by the data dictionary, without additional storage space. 3. A view can be used to display data in the base table in different forms. A view is powerful in that it can sort the data in the base table according to the needs of different users. That is to say, you can create different views based on different requirements. You can use the views to set columns and data rows that can be accessed by users, this provides additional Security Control for tables to hide the data complexity view. join can be used to create a new dataset with columns related to multiple tables. This view hides the fact that data comes from multiple tables. 3.1 simplify your SQL statements users can use views to query information from multiple tables without having to know how these tables are connected. The column names of the Data View in the base table can be arbitrarily changed from different angles, without affecting the base table of the view so that the application will not be affected by the definition change of the base table, it is actually the result of an SQL statement operation used as the base table of the view. 3.2 saving a complex query a query may perform complex calculations on the table data. After you save the query as a view, you only need to query the view for similar computing each time. The Logical Data independence view can make applications and database tables independent to a certain extent. If there is no view, the application must be created on the table. With the view, the program can be built on the view, so that the program and the database table are separated by the view. Raw Data Security: www.2cto.com 4. The working mechanism view of the view is the query statement it uses. Oracle stores this definition in the data dictionary as text. When you reference a view in an SQL statement, Oracle performs the following operations: integrate the statements that reference the view with the Definition Statement of the view into a statement that is parsed and integrated in the shared SQL zone. Execute this statement when there is no consolidated statement in the existing shared SQL zone. when consistent, oracle will create a new shared SQL zone for this statement. Therefore, SQL statements that reference a view can also use the existing shared SQL zone to save memory and improve performance. 5. View dependency
A view is a query that references other objects (tables, views). Therefore, a view depends on the referenced objects. Oracle automatically processes view dependencies. For example, if you remove a base table from a view and recreate the table, Oracle checks whether the new base table conforms to the view definition and determines whether the view is valid. 6. updatable connection view refers to multiple tables or views referenced in the from clause of the definition query of a view. The updatable connection view is the connection view that can execute UPDATE, INSERT, and DELETE operations. To ensure that the view is updatable, its definition cannot contain the following syntax structure: Set operator www.2cto.com DISTINCT operator aggregate function or analyticdb function group by, order by, connect, or the start with clause uses the set expression in the list after SELECT to use the subquery join in the list after SELECT (except in the case of exceptions) for views that cannot be updated, you can use the instead of trigger to modify the data.