Oracle PL/SQL VIEW TABLES
A sql server view is a logical representation of another table or combination of tables that do not physically exist. These tables are called base tables. Base tables might in turn be actual tables or might be views themselves.
All operations performed on a oralce database view actually affect the base table of the view. You can use views in almost the same way as tables. You can query, update, insert into, and delete from views, just as you can standard tables.
Views can provide a different representation (such as subsets or supersets) of the data that resides within other Oracle tables and views. Oracle views are very powerful because they allow you to tailor the presentation of data to different types of users.
The following sections explain how to create, replace, and drop views using SQL commands.
HOW TO CREATE a VIEW in Oracle PL/SQL
The Oracle VIEW DEFINITION in pl sql Oracle is:
CREATE VIEW view_name AS
SELECT columns
FROM table
WHERE predicates;
This would create a virtual table based on the result set of the select statement. You can now query the view as follows:
HOW TO UPDATE a VIEW in Oracle
You can update a VIEW without dropping it by using the REPLACE command:
CREATE OR REPLACE VIEW view_name AS
SELECT columns
FROM table
WHERE predicates;
HOW TO DROP a VIEW in Oracle
The syntax for dropping a VIEW is:
DROP VIEW view_name;
|