GeekInterview.com
Series: Subject: Topic:
Question: 32 of 133

what is the function of 'force' in view?

Asked by: Interview Candidate | Asked on: Mar 17th, 2006
Showing Answers 1 - 15 of 15 Answers
arvind

Answered On : Mar 17th, 2006

Force is used to create the view name even if that name was already exist in the schema,In breif it acts like a create or replace of Package/Procedure/Functions.

  
Login to rate this answer.
Ashish

Answered On : Mar 17th, 2006

It will create the view even if there are errors in the SQL statement.

  
Login to rate this answer.
vishnu

Answered On : Mar 20th, 2006

Hi, As per Oracle Documentation a view can be created without existence of Base table and not to replace a view. As two views can not be created with same name.I have tried to create view with option FORCE without a table but recieved an exception "ORA-00942: table or view does not exist"Can any one pls suggest hot to use this FORCE option, pls mail me at vishnu.sriramula@gmail.com.Thanks in advancevishnu

  
Login to rate this answer.
pawan ahuja

Answered On : Mar 21st, 2006

View all answers by pawan ahuja

 this the 100% correct. Hi, A view can be created without existence of Base table and not to replace a view. As two views can not be created with same name./*Actually one more thing important is that u can create view without the defination of table With force option. it will be create but the status of the view will be invalid*/ RegardsPawan Ahuja919342927335

  
Login to rate this answer.
tarun

Answered On : Apr 27th, 2006

Force in view is used to create the view even if there is no existence of the base tables on which the view is created

  
Login to rate this answer.
narasimhulu

Answered On : May 31st, 2006

View all answers by narasimhulu

hiIts impossible to create a view without a base table.I request you to check out that documentation once again properly

  
Login to rate this answer.
AyanM

Answered On : Jul 11th, 2006

View all answers by AyanM

Its possible to create a view without having the base table and that is force view. While creating the force view it will show an erorr message (due to non existance of the base table) - ignore that. Any select query on this view will return error at this point of time. Create the base table now and try to select from the view. The select query will work now.

  
Login to rate this answer.
Shiv Mangal Rahi

Answered On : Jul 21st, 2006

Hi All,Force view is created only when you want to create a view for which base table doesnt exist. As it will only create view but could not be used because it will be in invalid mode.It will come in valid mode only when you will create respective base table and recompile the view.For example:Suppose we try to create a view vw_emp on a non existing table emp.SQL> Create View vw_emp as Select empid, empname from emp;This command will give an error ORA-000942.However if we use the FORCE option, it will create the view.However trying to access the view gives an error,because the table 'emp' doesnt exist. SQL> Create FORCE VIEW vw_emp as select empid,empname from emp;It will give a warning: View created with compilation error.      

  
Login to rate this answer.
Narendra Joshi

Answered On : Jul 27th, 2006

When a view is created that refers to a non-existent table or an invalid column of an existing table, or if the owner of the view does not have the required privileges, then the view can still be created and entered into the data dictionary with FORSE option.

  
Login to rate this answer.
Rama Krishna

Answered On : Aug 6th, 2006

"Force" option used to create a view without existance of Table in the databaseSyntax: Create or replace FORCE VIEW as select  * from <non-exist tab name>Thanks&RegdsRamki,TCS,Hyd 9989018508

  
Login to rate this answer.
accrash

Answered On : Mar 12th, 2010

View all answers by accrash

The use of force is to create a view even if the base doesnt exist but if one will create a view using this option it will give you compilation error at the time of creating it . The only use that I can understand is that suppose we are not sure about the table then also a view can be created but in order to use the view, first base has to created. Suppose I want to create a view called temp based on the table test (doesnt exist) then the command will be create force view temp as   select * from test;It will create the view but with compilation error. One can see the status of it as INVALID by querying user_objects , dba_objects depends on the user through which you are connecting Hope this will help!

  
Login to rate this answer.
SujitKr

Answered On : Mar 14th, 2010

View all answers by SujitKr

The Clause "force" implies to create a view without there being base table. The View remains invalid untill the base table named in the creation is created. As soon as the base table becomes live, the View becomes Valid.eg. create force view s as select ename,sal,deptno from ss;here table "ss" has not yet been createdso o/p would be view created with compilation errors.now as soon as the table "ss" is created then the view "s" becomes valid.Now, you can query the view but, o/p will be no "no rows selected" as the table "ss" yet doesn't contain data. Insert Data and now, view will return data.Sujit

  
Login to rate this answer.
Ganesh D. Dalvi

Answered On : Oct 20th, 2011

Hey vishnu,
we create the FORCE view on the table which is not exist in our database. it will show the error but actually that view is created with your specify name.
Just try it

  
Login to rate this answer.
Mayank Ahuja

Answered On : Nov 1st, 2011

View all answers by Mayank Ahuja

The function of force in a view is to create a view forcefully witout the existence of a Schema

  
Login to rate this answer.
murali

Answered On : Apr 18th, 2013

Views are created by without base tables is called force views...

  
Login to rate this answer.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

Related Open Questions

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.