GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Oracle  >  SQL Plus
Go To First  |  Previous Question  |  Next Question 
 SQL Plus  |  Question 102 of 132    Print  
what is the function of 'force' in view?

  
Total Answers and Comments: 10 Last Update: August 06, 2006     Asked by: michelle 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
March 17, 2006 06:00:53   #1  
arvind        

RE: what is the function of 'force' in view?
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.
 
Is this answer useful? Yes | No
March 17, 2006 06:59:35   #2  
Ashish        

RE: what is the function of 'force' in view?
It will create the view even if there are errors in the SQL statement.
 
Is this answer useful? Yes | No
March 20, 2006 05:32:48   #3  
vishnu        

RE: what is the function of 'force' in view?

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 advance

vishnu


 
Is this answer useful? Yes | No
March 21, 2006 01:46:32   #4  
pawan ahuja Member Since: March 2006   Contribution: 6    

RE: what is the function of 'force' in view?
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*/

Regards

Pawan Ahuja

919342927335


 
Is this answer useful? Yes | No
April 27, 2006 00:34:25   #5  
tarun        

RE: what is the function of 'force' in view?
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
 
Is this answer useful? Yes | No
May 31, 2006 07:10:07   #6  
narasimhulu Member Since: May 2006   Contribution: 4    

RE: what is the function of 'force' in view?

hi

Its impossible to create a view without a base table.

I request you to check out that documentation once again properly


 
Is this answer useful? Yes | No
July 11, 2006 07:05:37   #7  
AyanM Member Since: July 2006   Contribution: 3    

RE: what is the function of 'force' in view?
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.
 
Is this answer useful? Yes | No
July 21, 2006 05:08:58   #8  
Shiv Mangal Rahi        

RE: what is the function of 'force' in view?

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.


 
Is this answer useful? Yes | No
July 27, 2006 06:17:32   #9  
Narendra Joshi        

RE: what is the function of 'force' in view?
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.
 
Is this answer useful? Yes | No
August 06, 2006 00:10:52   #10  
Rama Krishna        

RE: what is the function of 'force' in view?

Force option used to create a view without existance of Table in the database

Syntax: Create or replace FORCE VIEW as select * from <non-exist tab name>

Thanks&Regds

Ramki TCS Hyd 9989018508


 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape