GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Oracle  >  SQL
Go To First  |  Previous Question  |  Next Question 
 SQL  |  Question 109 of 171    Print  
Is it possible to update Views? If yes, How, If Not, Why?

  
Total Answers and Comments: 12 Last Update: April 23, 2009     Asked by: nagurtilak 
  
 Sponsored Links

 
 Best Rated Answer
Submitted by: Shailendra Nigam
 

Hi

I am shailendra

its my op.

yes

you can update the view

suppose you can create the view

create view v1 as select ename,sal from emp

suppose you want to update the view according to salary

update v1 set ename='shailendra' where sal=800;



Above answer was rated as good by the following members:
spohilko
  Sorting Options  
  Page 1 of 2   « First    1    2    >     Last »  
December 13, 2006 11:01:35   #1  
Shikhar        

RE: Is it possible to update Views? If yes, How, If No...
You cannot update a view by writting a insert update or delete query on the view. If you want to update some data in the view than you have to update the underlying tables.
 
Is this answer useful? Yes | No
December 19, 2006 12:33:52   #2  
Dev        

RE: Is it possible to update Views? If yes, How, If No...

Hi Shikar

You are wrong. We can update a view by using insert update delete statements.

A view from a single table can be updated where as a view from multiple tables can not be updated.

Thanks

Dev.


 
Is this answer useful? Yes | No
December 21, 2006 11:01:31   #3  
ramesh t        

RE: Is it possible to update Views? If yes, How, If No...

the meaning of view is snapshot of the table .

without disturbing the main table we done in view so we can perform the dml commnads in it.

i think u understood


 
Is this answer useful? Yes | No
December 29, 2006 05:18:49   #4  
srikanth        

RE: Is it possible to update Views? If yes, How, If No...

view is collection of data but itis not stored in database.To simplfy the selected statements we can use view and itis snapshot for table

we can update view by using DML commands


 
Is this answer useful? Yes | No
January 03, 2007 00:04:17   #5  
rajesh        

RE: Is it possible to update Views? If yes, How, If No...
If u have Created a View.. based on 2 Tables... u can use dml statements on that view.. but u can perform DML Operations Only on Key Preserved Table.
 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    
January 04, 2007 07:25:19   #6  
Shailendra Nigam        

RE: Is it possible to update Views? If yes, How, If No...

Hi

I am shailendra

its my op.

yes

you can update the view

suppose you can create the view

create view v1 as select ename sal from emp

suppose you want to update the view according to salary

update v1 set ename 'shailendra' where sal 800;


 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    
January 05, 2007 04:24:24   #7  
rahul Omanwar        

RE: Is it possible to update Views? If yes, How, If No...

Hello Shailendra

This is rahul.As per discussion on views. I want to share some thing. There are two types of views namely Simple and complex views.

U can perform DML operation on simple views which is based on single table and that view doesn't contain any single row function and any group by clause and it has to satiesfy integrity constraint also.

U can't perform DML operation on complex views becuase they are based on multiple table. U can achive this task by using Triggers(Instade of...).

If u have any suggestion on bellow discussion please send mail to rahul_omanwar@hotmail.com.

Thanks and regards

Rahul Omanwar

mob no : 9423612912


 
Is this answer useful? Yes | No
February 07, 2007 02:15:52   #8  
srinivasaraok        

RE: Is it possible to update Views? If yes, How, If No...
Hi

Suppose you want update view means that time you need to use insted of trigger with that only possible to update view



Srinivas

 
Is this answer useful? Yes | No
February 22, 2007 06:34:58   #9  
Gman        

RE: Is it possible to update Views? If yes, How, If No...
A materialized view can be updated.
 
Is this answer useful? Yes | No
March 13, 2007 02:06:16   #10  
sreenivas        

RE: Is it possible to update Views? If yes, How, If No...
Hai I am sreenivas kumar from Andhra Pradesh.
Yes it is possible to update the vies created on single table if the vies are created on multiple tables then it is not possible to update if we want to update these type of vies then we have to create an instead of trigger then only we can update the views created on multiple tables.

 
Is this answer useful? Yes | No
  Page 1 of 2   « First    1    2    >     Last »  


 
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