GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

  GeekInterview.com  >  Interview Questions  >  Database  >  Sybase

 Print  |  
Question:  Views 'with check' Option

Answer: What is the use of 'with check' option in views?


November 11, 2008 22:45:01 #2
 dhampack   Member Since: November 2008    Total Comments: 6 

RE: Views 'with check' Option
 
When you create a view using the with check option clause, each insert and update through the view, is validated against the view’s selection criteria. If the rows inserted or updated are out of criteria then it fails and gives error message. For ex, you have a view named sybase_books
create view sybase_books as select * from books where type='sybase' with check option.
If you try to insert rows through view where type='oracle' then it will fail, for ex
insert into sybase_books values ('Oracle theory','oracle')
     

 

Back To Question