Updatable Join Views (181)

tsinglee發表於2007-11-11

A join view is defined as a view that has more than one table or view in its FROM
clause (a join) and that does not use any of these clauses: DISTINCT, aggregation,
GROUP BY, START WITH, CONNECT BY, ROWNUM, and set operations (UNION ALL,
INTERSECT, and so on).

An updatable join view is a join view that involves two or more base tables or views,
where UPDATE, INSERT, and DELETE operations are permitted. The data dictionary
views ALL_UPDATABLE_COLUMNS, DBA_UPDATABLE_COLUMNS, and USER_UPDATABLE_COLUMNS
contain information that indicates which of the view columns
are updatable. In order to be inherently updatable, a view cannot contain any of the
following constructs:

■ A set operator
■ A DISTINCT operator
■ An aggregate or analytic function
■ A GROUP BY, ORDER BY, CONNECT BY, or START WITH clause
■ A collection expression in a SELECT list
■ A subquery in a SELECT list
■ Joins (with some exceptions)
Views that are not updatable can be modified using INSTEAD OF triggers.

可更新的連線檢視
1. 連線檢視指在一個檢視的定義查詢的 FROM 字句中引用了多個表或檢視 ,且查詢中沒有使用以下子句:DISTINCT,聚合函式等.
2. 可更新連線檢視是指涉及到兩張或以上的表進行DML操作是被允許的
3. 從ALL_UPDATABLE_COLUMNS, DBA_UPDATABLE_COLUMNS等字典檢視中可查詢出哪些檢視列是可被更新的
4. 包含以下運算結構的檢視不能更新 :set , disitnct 等
5. 對於不可更新的檢視,可以利用 INSTEAD OF 觸發器對其資料進行修改

[@more@]

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/10599713/viewspace-981772/,如需轉載,請註明出處,否則將追究法律責任。

相關文章