Creating Force Views:
Even if the Sometimes a table may be created at a later time for that a view must be created first. In this type of cases, a view can be created for the tables which are not available but querying cannot be performed so the keyword FORCE is used to do this:
Syntax:
CREATE OR REPLACE FORCE VIEW FV AS <QUERY>;
Example:
CREATE OR REPLACE FORCE VIEW fv AS SELECT * FROM students;
The given query of view generates an output as given below:
Output: Warning: View created with compilation errors.
Selection from the view is not possible since the table is created. Simply then the view becomes valid. The querying from the View will result in before the table is created:
SELECT * from fv;
SELECT * from fv
* ERROR at line 1:
ORA-04063: view "HEMA.FV" has errors