What is the role of with check option in a view?

Source: Internet
Author: User

Create view is_student
As
Select SnO, sname, sage
From student
Where sdept = 'is'
 With check Option;
With check option;, the insert operation cannot be performed:

Insert into is_student
Values ('20140901', 'lila', 12)

Why? Do not addWith check OptionYes!

With check OptionIt can be explained as follows:The modified view must also be used to view the modified result.. For example, if you insert, the added record must be visible after refreshing the view;
If it is modified, the modified results must be displayed in this view. If it is deleted, you can only delete the records displayed in the view.

However, you only query the sdept = 'is' record. What you insert does not comply with sdept = 'is' at all, so it won't work.

that is to say, when executing insert, sdept is 'is' by default to meet with check option, right?
Does DBMS automatically add sdept = 'is? Because in the view is_student, all the ISIS selected. students!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.