can we update a view which is created from two tables
Answers were Sorted based on User's Feedback
Answer / haritha
we can not update a view which is created from two
tables.But we can update a view which is created from one
table.
| Is This Answer Correct ? | 47 Yes | 10 No |
Answer / arup ratan banerjee
U can update non-updatable views to updatable ones by means
of Instead Of Triggers
| Is This Answer Correct ? | 9 Yes | 1 No |
Answer / brajesh
yes,but only of those column from which table primary key
is preserved in view
| Is This Answer Correct ? | 8 Yes | 1 No |
Answer / usha
UPDATE PRODUCT SET UNITPRICE=UNITPRICE+(UNITPRICE*0.2)WHERE
CATEGORIES.CATEGORYNAME=PRODUCT.CATEGORYID;
| Is This Answer Correct ? | 7 Yes | 1 No |
Answer / raj
folks, I check in practically that View (consist of more
then one table) can update and it impact at Base Table also.
(you can also check from your own self...)
but I data cannot delete from view.
| Is This Answer Correct ? | 2 Yes | 1 No |
Answer / sankar
It is not possible to update a view which is created from
two tables.Actually when we update any viewtha first the
view has been updated followed by the base table.If we use
instead of trigger then the base be table will updated
first not the view.Because the view is stored in database
as a query.Once the base table will be changed,the view
query will hit the base table and reflects the changes.But
I think that's not the desired answer.
| Is This Answer Correct ? | 5 Yes | 5 No |
Answer / duong
Views in all versions of SQL Server are updatable (can be the target of UPDATE, DELETE, or INSERT statements), as long as the modification affects only one of the base tables referenced by the view, for example:
-- Increase the prices for publisher '0736' by 10%.
UPDATE titleview
SET price = price * 1.10
WHERE pub_id = '0736'
GO
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / chamin
You can't do it in data bound mode for SQL Server 2000.It
gives an error called
"Insufficient key column information for updating or refreshing"
| Is This Answer Correct ? | 2 Yes | 6 No |
What are types of joins?
what is mean by forward declaration and where we'll use it.
What is a column in a table?
Can instead of triggers be used to fire once for each statement on a view?
how u can find the n row from a table?
What are the benefits of pl sql?
What are different methods to trace the pl/sql code?
Are null values same as that of zero or a blank space?
what is meant by tuning and tk proof?
Under what condition it is possible to have a page level lock and row lock at the same time for a query? : Transact sql
What if we write return in procedure?
what are the limitations of identity column? : Transact sql
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)