What is a View as Object in Oracle Views

By

View is an oracle objects that can be created by issuing a DDL "CREATE VIEW" Statement. A view can be basically defined as a projection of one or more tables. View has basic advantages and some disadvantages. At time no DML operation can be conduction on a view this depends on the type of view...To understand what is view read details....

Views are generally create by basic CREATE statement with a Query.

Eg . Create View View_Name as (Select colname1,colname2 from table name)
The above statement creates a view by the name specified (VIEW_NAME). Such view which is a simple projection of one table is  created by using a simple select statement. In such view DML statement can work if its not violating any integrating constraints of the TABLE on which  it is create and also the user has all the DML privileges' on the TABLE(if view created in different user)

Consider another example where view is created by issuing following Query Statement

Create View View_Name as (Select a.colname1,b.colname2 from tablename1 a, tablename2 b
where a.colname1=b.colname1)
The above view wich is a project of 2 tables and  will not permit any DML operation on the view .

  Consider another example where view is created by issuing following Query Statement

Create View View_Name as (Select count(colname) ,colname2 from table name
Group by colname2
The above view which is again a projection of 1 table will not permit any DML operation on the view .

So To Conclude We can Say DML operation in a view cannot be performed if the view is based on more than one tables or if the view has some group functions used.

To create or to Over write an existing view use the command as
CREATE OR REPLACE VIEW VIEW_NAME AS (select ..........)

Other type of View are INLINE VIEW  which are not an object but a runtime view.