DML Views

1  view of insertable,updable,deletable

SQL> CREATE VIEW V4(or_no, or_date, cust_id)
  2  AS SELECT order_id, order_date, customer_id
  3  FROM orders
  4  WHERE order_date < '30-mar-2007' WITH CHECK OPTION;

视图已创建。

SQL> select text from user_views where view_name='V4';

TEXT
------------------------------------------------------------
SELECT order_id, order_date, customer_id
FROM orders
WHERE order_date < '30-mar-

SQL>  select column_name,insertable,updatable,deletable
  2   from user_updatable_columns
  3   where column_name in ('OR_NO','OR_DATE','CUST_ID')
  4  ;

COLUMN_NAME                    INS UPD DEL
------------------------------ --- --- ---
OR_NO                          YES YES YES
OR_DATE                        YES YES YES
CUST_ID                        YES YES YES

SQL> select column_name,insertable,updatable,deletable
  2  from user_updatable_columns
  3  where table_name IN('ORDERS','ORDER_ITEMS')
  4  AND column_name in ('ORDER_ID','LINE_ITEM_ID')
  5  /

COLUMN_NAME                    INS UPD DEL
------------------------------ --- --- ---
ORDER_ID                       YES YES YES
ORDER_ID                       YES YES YES
LINE_ITEM_ID                   YES YES YES

----

USER_UPDATABLE_COLUMNS describes columns in a join view that can be updated by the current user, subject to appropriate privileges. Its columns are the same as those in "ALL_UPDATABLE_COLUMNS".

ALL_UPDATABLE_COLUMNS describes all columns in a join view that are updatable by the current user, subject to appropriate privileges.

DBA_UPDATABLE_COLUMNS describes all columns in a join view that are updatable by the database administrator, subject to appropriate privileges.

2  Dml of Object Views

A view is not updatable if its view query contains joins, set operators, rownumthe.columns defined by  expression,aggregate functions, GROUP BY, or DISTINCT. If a view query contains pseudocolumns or expressions, the corresponding view columns are not updatable. Object views often involve joins.

---end---

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/13750068/viewspace-718882/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/13750068/viewspace-718882/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值