Creating and Managing Views
Views allow users to save queries. Views are not physically stored on disks. Queries to a view run as subqueries. A database only stores the definition of a view and does not store its data. The data is still stored in the original base table. If data in the base table changes, the data in the view changes accordingly. In this sense, a view is like a window through which users can know their interested data and data changes in the database. A view is triggered every time it is referenced.
Creating a view
The OR REPLACE parameter in this command is optional. It indicates that if the view exists, the new view will replace the existing view.
View Details
- View the MyView view. Real-time data will be returned.
- Run the following command to query the views in the current user:
- Run the following command to query all views:
- View details about a specified view.
Rebuilding a View
Run the ALTER VIEW command to rebuild a view without entering query statements.
Deleting a View
DROP VIEW ... The CASCADE command can be used to delete objects that depend on the view. For example, view A depends on view B. If view B is deleted, view A will also be deleted. Without the CASCADE option, the DROP VIEW command will fail.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.