What Is A VIEW in Oracle
What Is A VIEW in Oracle
An Oracle VIEW, in essence, is a virtual table that does not physically exist. Rather, it is created
by a query joining one or more tables.
Create VIEW
Syntax
Example
This Oracle CREATE VIEW example would create a virtual table based on the result set of the
SELECT statement. You can now query the Oracle VIEW as follows:
SELECT *
FROM sup_orders;
Update VIEW
You can modify the definition of an Oracle VIEW without dropping it by using the Oracle
CREATE OR REPLACE VIEW Statement.
Syntax
The syntax for the CREATE OR REPLACE VIEW Statement in Oracle/PLSQL is:
Example
Here is an example of how you would use the Oracle CREATE OR REPLACE VIEW
Statement:
This Oracle CREATE OR REPLACE VIEW example would update the definition of the Oracle
VIEW called sup_orders without dropping it. If the Oracle VIEW did not yet exist, the VIEW
would merely be created for the first time.
Drop VIEW
Once an Oracle VIEW has been created, you can drop it with the Oracle DROP VIEW
Statement.
Syntax
Example
This Oracle DROP VIEW example would drop/delete the Oracle VIEW called sup_orders.