Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


what is 'force view'?

Answers were Sorted based on User's Feedback



what is 'force view'?..

Answer / m arun kumar

FORCE
The FORCE option of the CREATE VIEW statement can be used
to create the object even if one of the underlying objects
(i.e. referenced within the view) do not exist.

This can be useful if the views are created before the
underlying objects in creation scripts etc.
/* Try to create a view against a table which does not
exist */

SQL> CREATE OR REPLACE VIEW test_view
2 AS
3 SELECT * FROM non_existent_table;
SELECT * FROM non_existent_table
*
ERROR at line 3:
ORA-00942: table or view does not exist

/* Hence, the view does not exists */

SQL> SELECT * FROM test_view;
SELECT * FROM test_view
*
ERROR at line 1:
ORA-00942: table or view does not exist

/* Specifying FORCE creates the view object (albeit with
errors) */

SQL> CREATE OR REPLACE FORCE VIEW test_view
2 AS
3 SELECT * FROM non_existent_table;

Warning: View created with compilation errors.

/* Trying to SELECT from the view implies it's been created
*/

SQL> SELECT * FROM test_view;
SELECT * FROM test_view
*
ERROR at line 1:
ORA-04063: view "ORAUSER.TEST_VIEW" has errors

/* Creating the missing object then allows us to select
from it */

SQL> CREATE TABLE non_existent_table
2 (
3 a VARCHAR2(10)
4 );

Table created.

SQL> SELECT * FROM test_view;

no rows selected

Is This Answer Correct ?    19 Yes 1 No

what is 'force view'?..

Answer / suresh

the view can be created without base table then the view is
called force view. the view must be crated with force option.

Is This Answer Correct ?    16 Yes 0 No

what is 'force view'?..

Answer / dinesh kumar

Force View creates view even if the base table is not
available.

Is This Answer Correct ?    4 Yes 0 No

Post New Answer

More SQL PLSQL Interview Questions

My select statement is not working as expected, So, to overcome from such issues what are the steps needed to be taken care?

2 Answers   CG,


What are triggers and its uses?

0 Answers  


How One can easily select all even, odd, or Nth rows from a table using SQL queries?

4 Answers  


How do I quit sql?

0 Answers  


we have a package and we have grants to execute that package inside of that we have table, here we don't have privileges to this table? whether this package will execute or not?

3 Answers   TCS,


What is character functions?

0 Answers  


what is column? : Sql dba

0 Answers  


Is sql procedural language?

0 Answers  


What is dcl in sql?

0 Answers  


define primary key & secondary key?

2 Answers  


Write a query to find five highest salaries from EMP table. (there is a column SALARY)

24 Answers   Cap Gemini, iNautix,


Can you sum a count in sql?

0 Answers  


Categories