Renaming views  Modifying data through views

Chapter 11: Views: Limiting Access to Data

Altering or dropping underlying objects

You can change the name of a view’s underlying objects. For example, if a view references a table entitled new_sales, and you rename that table to old_sales, the view will work on the renamed table.

However, if a table referenced by a view has been dropped, and someone tries to use the view, Adaptive Server produces an error message. If a new table or view is created to replace the one that was dropped, the view again becomes usable.

If you define a view with a select * clause, and then alter the structure of its underlying tables by adding columns, the new columns do not appear. This is because the asterisk shorthand is interpreted and expanded when the view is first created. To see the new columns, drop the view and re-create it.





Copyright © 2005. Sybase Inc. All rights reserved. Modifying data through views

View this book as PDF