tags:

views:

44

answers:

2

In context of Oracle 9i database, usually for a view to be created an underlying base table is mandatory, however this constraint can be violated if the FORCED clause is used while creating the view. What is the significance of these views if their base tables does not exist? In which conditions these views will be of help?

+3  A: 

Hi Sachin,

you would use the FORCE keyword if you are creating several views that reference each other and you don't want to spend time to determine in which order they should be created.

See also:

streamlining creating of packages and views

Vincent Malgrat
+2  A: 

On a large project this can be very useful: I create a table, someone else creates a packaged function, and you create a view that accesses the table and the packaged function. We then all put our DDL into the source control / release system and the DBA installs all the code on the test / production system. The FORCE keyword ensures that the view gets created, though possibly in an invalid state, even if its DDL is run before the table and/or package DDL.

Tony Andrews
Yes thats true and I agreed, but what is the significance of that view which is created without having an underlying base table
Sachin Chourasiya
It has no significance until the underlying base table is created - at which point it becomes a valid, usable view. It is all about making the DBAs life easier, not having to line up 100s of DDL scripts in "the right order".
Tony Andrews