create view---check option

简介:

create view pb_quarters as
select * from piggy_bank 
where coin = 'Q'

select * from pb_quarters

create view pb_dimes as
select * from piggy_bank
where coin = 'D'

select * from pb_dimes

create view pb_neckel as
select * from piggy_bank
where coin = 'N' with check option

select * from pb_neckel

insert into pb_quarters values('Q', '1993')
select * from pb_quarters

insert into pb_quarters values('D', '1942')
select * from pb_quarters

1.当插入视图的值在视图中不存在,则插入无效,如果‘D’不存在,则插入无效,而Q存在,则insert 有效。












本文转自鹅倌51CTO博客,原文链接: http://blog.51cto.com/kaixinbuliao/881679,如需转载请自行联系原作者






相关文章
|
12月前
SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘thinkphp.test‘ don‘t exsit
SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘thinkphp.test‘ don‘t exsit
309 0
|
关系型数据库 MySQL 数据库
View ‘information_schema.SCHEMATA‘ references invalid table(s) or column(s) or function(s) or define
View ‘information_schema.SCHEMATA‘ references invalid table(s) or column(s) or function(s) or define
224 0
|
SQL 关系型数据库 MySQL
mysql Error Code: 1175. You are using safe update mode and you tried to update a table without ....
mysql Error Code: 1175. You are using safe update mode and you tried to update a table without ....
218 0
mysql Error Code: 1175. You are using safe update mode and you tried to update a table without ....
|
关系型数据库 MySQL 数据库
[Err] 1143 - SELECT command denied to user 'XX'@'%' for column 'XXX' in table 'XX'
[Err] 1143 - SELECT command denied to user 'XX'@'%' for column 'XXX' in table 'XX'
281 0
[Err] 1143 - SELECT command denied to user 'XX'@'%' for column 'XXX' in table 'XX'
|
SQL 数据库管理 关系型数据库
SP2-0618: Cannot find the Session Identifier. Check PLUSTRACE role is enabled
测试环境:OEL6.5+Oracle 11g R2在进行执行计划测试的时候,遇到一个小问题。在用普通用户执行下面这条命令的时候,普通用户名为hhu,已经赋予了create session和resource权限。
1128 1
|
缓存 关系型数据库 MySQL
|
缓存 MySQL 关系型数据库