2.8 Managing Views
A view is a logical representation of another table or combination of tables. You can create, browse, edit, download, compile, drop a view and view reports.
A view does not contain or store data but derives its data from the views or tables on which it is based. These tables are called base tables. All operations performed on a view affect the base table of the view. In order to be updatable, a view cannot contain any of the following constructs: SET
or DISTINCT
, operators, aggregate or analytic functions, GROUP BY
, ORDER BY
, CONNECT BY
, START WITH
clause, subquery, or collection expression in a SELECT
list.
For an example where using a view might be preferable to a table, consider the HR.EMPLOYEES
table which has several columns and numerous rows. To allow users to see only five of these columns or only specific rows, a view is created as follows:
CREATE VIEW staff AS SELECT employee_id, last_name, job_id, manager_id, department_id FROM employees
- Creating a View
Create a view using Object Browser. - Browsing a View
Select a view from the Object Selection pane and view different reports about the view. - Reports for Views
Alternative views available when browsing a view in Object Browser. - Editing a View Manually
When you edit a view you can edit the code manually, perform a search and replace, and compile the view. - Using Find and Replace
Select a view from the Object Selection pane and click Find or Replace. - Downloading a View
Select a view from the Object Selection pane and download a view by clicking Download Source. - Compiling a View
If you edit and make changes to a view, you must compile to save your changes. - Dropping a View
Select a view from the Object Selection pane, select the View or Code tab, and click Drop.
See Also:
Parent topic: Managing Database Objects with Object Browser
2.8.1 Creating a View
Create a view using Object Browser.
To create a view:
See Also:
Parent topic: Managing Views
2.8.2 Browsing a View
Select a view from the Object Selection pane and view different reports about the view.
When you access a view in Object Browser, the Detail pane displays a report listing the columns in that view.
To browse a view:
See Also:
Parent topic: Managing Views
2.8.3 Reports for Views
Alternative views available when browsing a view in Object Browser.
Table 2-3 describes all available reports for views.
Table 2-3 Available Reports for Views
See Also:
Parent topic: Managing Views
2.8.4 Editing a View Manually
When you edit a view you can edit the code manually, perform a search and replace, and compile the view.
You can save the view as a file or drop it.
To edit a view manually:
See Also:
Parent topic: Managing Views
2.8.5 Using Find and Replace
Select a view from the Object Selection pane and click Find or Replace.
To use Find and Replace:
Parent topic: Managing Views
2.8.6 Downloading a View
Select a view from the Object Selection pane and download a view by clicking Download Source.
To save the current view as a file:
Parent topic: Managing Views
2.8.7 Compiling a View
If you edit and make changes to a view, you must compile to save your changes.
There is no save function since this is just a view of the object within the database.
To re-create the current view:
Parent topic: Managing Views
2.8.8 Dropping a View
Select a view from the Object Selection pane, select the View or Code tab, and click Drop.
To drop a view:
Parent topic: Managing Views