暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

oracle create read only view创建只读视图

原创 Anbob 2011-03-15
958
建立只读简单视图
SQL> create table test(id int,name varchar(20));
Table created.
SQL> insert into test(1,'anbob.com');
insert into test(1,'anbob.com')
*
ERROR at line 1:
ORA-00928: missing SELECT keyword

SQL> insert into test values(1,'anbob.com');
1 row created.
SQL> insert into test values(2,'weejar.com');
1 row created.
SQL> commit;
Commit complete.
SQL> select * from test;
ID NAME
---------- ----------------------------------------
1 anbob.com
2 weejar.com
SQL> create view v_t
2  is
3  select id,name from test;
is
*
ERROR at line 2:
ORA-00905: missing keyword

SQL> create view v_t
2  as
3  select id,name from test;
View created.
SQL> insert into v_t values(3,'a');
1 row created.
SQL> commit;
Commit complete.
SQL> create view v_t_read
2  as
3  select id,name from test
4  with read only;
View created.
SQL> insert into v_t_read values(3,'a');
insert into v_t_read values(3,'a')
*
ERROR at line 1:
ORA-01733: virtual column not allowed here
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论