Leigh Jones : outsourcing fulfilment, CMS G3 content management system

April 24, 2008

Usa to Canada

Filed under: Uncategorized — admin @ 11:34 am

A simple view usually allows you to update data in the underlying table through the view. You will examine this capability later in this chapter. There is a problem that sometimes crops up when using views to insert or update data: You can create a record that does not fit the view’s query and therefore does not appear in the view. For example, imagine that you use the USARTISTS view to update the country from USA to Canada for one of the artists. You want to check the results, but querying the view no longer displays the record. It is as if the record disappeared after you
updated it. Obviously, the record is in the table and simply is not displayed in the view. However, this fact may not be obvious to other users who are not familiar with the query that is used by the view.
To prevent users from updating or inserting records not fitting within the view, you create a constraint view. Another good reason to use a constraint view is that it provides a form of security. Views are frequently used to limit a user’s access to certain rows and columns within the base table.
The user should not be able to update rows not appearing in the view, but Figure 19.2 Querying a View Is Just Like Querying a Table.

CREATE VIEW Syntax without the constraint clause, this could happen and could be a violation of your business rules. Create a constraint view that looks like the simple view, except it includes the WITH CHECK OPTION clause, by running the following command.

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by