Bo's Oracle Station

查看: 939|回复: 0

视图的约束

[复制链接]

1005

主题

1469

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
12012
发表于 2020-10-11 17:10:52 | 显示全部楼层 |阅读模式
  1. select  * from Locations;

  2. Select  Location_Id,  City, Country_Id
  3.                  From  Locations  l   Join  Countries C
  4.                 Using(Country_Id )
  5.                Join Regions Using(Region_Id)
  6.             Where Region_Name = 'Europe';

  7.    
  8.    
  9. Insert Into  (   Select  l.Location_Id,  l.City, l.Country_Id
  10.                  From  Locations  L   Join  Countries C
  11.                 on (l.Country_Id =c.Country_Id)
  12.                Join Regions Using(Region_Id)
  13.             Where Region_Name = 'Europe' )     
  14. VALUES (3300, 'Cardiff', 'UK');

  15. commit;


  16. select  * from Locations;
复制代码

  1. Create Or Replace View V3 As
  2. (Select  l.Location_Id,  l.City, l.Country_Id
  3.                  From  Locations  L   
  4.             Where  l.Country_Id= 'DE')
  5.             With Check Option;
  6.             
  7.   Insert Into   V3 Values ( 3800, 'XXX','CN') ;
  8.   
复制代码




SQL Error: ORA-01402: view WITH CHECK OPTION where-clause violation
01402. 00000 -  "view WITH CHECK OPTION where-clause violation"
*Cause:   
*Action:

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|手机版|Bo's Oracle Station   

GMT+8, 2024-5-3 01:52 , Processed in 0.031754 second(s), 24 queries .

快速回复 返回顶部 返回列表