Updatable Views

MIMIER's Updatable Views

转自:http://developer.mimer.com/documentation/html_92/Mimer_SQL_Engine_DocSet/Data_manipulation6.html

INSERT, UPDATE and DELETE statements may be used on views.

The operation is then performed on the base table upon which the view is defined. However, certain views may not be updated (for example a view containing DISTINCT values, where a single row in the view may represent several rows in the base table).

A view is not updatable if any of the following conditions are true:

  • the keyword DISTINCT is used in the view definition
  • the select list contains components other than column specifications, or contains more than one specification of the same column
  • the FROM clause specifies more than one table reference or refers to a non-updatable view
  • the GROUP BY clause is used in the view definition
  • the HAVING clause is used in the view definition
Note: By defining an INSTEAD OF trigger any view can be made updatable. If all the INSTEAD OF triggers on the view are dropped, the view will revert to not updatable if one or more of the conditions are true.

SQL Standards Updatable Views

In order to be updatable according to the SQL standard, a view must:
  • Have only one table T in its top-level FROM clause
  • Not use SELECT DISTINCT in its top-level FROM clause
  • Include all attributes from T that do not permit NULLs
  • Not refer to T in subqueries
  • Not use GROUP BY or aggregation

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值