The WITH CHECK OPTION is implemented at the end of a view definition.
CREATE VIEW redCars AS
(
SELECT type, model, registration, colour
FROM Vehicles
WHERE type = 'Car'
AND Colour = 'Red'
)
WITH CHECK OPTION
It ensures changes that would alter the returned rows cannot occur.
UPDATE redCars SET Registration = 'ABC123' will therefore succeed.
UPDATE redcars SET Colour = 'Blue' will not
Links :
DevX.com - The WITH CHECK OPTION option with views
Tony Rogerson - WITH CHECK on CREATE VIEW
No comments:
Post a Comment