botang 发表于 2020-10-11 17:10:52

视图的约束

select* from Locations;

SelectLocation_Id,City, Country_Id
               FromLocationsl   JoinCountries C
                Using(Country_Id )
               Join Regions Using(Region_Id)
            Where Region_Name = 'Europe';

   
   
Insert Into(   Selectl.Location_Id,l.City, l.Country_Id
               FromLocationsL   JoinCountries C
                on (l.Country_Id =c.Country_Id)
               Join Regions Using(Region_Id)
            Where Region_Name = 'Europe' )   
VALUES (3300, 'Cardiff', 'UK');

commit;


select* from Locations;

Create Or Replace View V3 As
(Selectl.Location_Id,l.City, l.Country_Id
               FromLocationsL   
            Wherel.Country_Id= 'DE')
            With Check Option;
            
Insert Into   V3 Values ( 3800, 'XXX','CN') ;




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

页: [1]
查看完整版本: 视图的约束