Solved

Oracle merge/update into view?

Posted on 2008-10-23
1
761 Views
Last Modified: 2013-12-18
If I have a view such as the following would there be any difference between using merge/update statements on the Products and the view MyProducts?
CREATE VIEW MyProducts

AS

SELECT * FROM Products, ProductCat

WHERE Product.ID = ProductCat.ProdID

AND ProductCat.Account = 1

Open in new window

0
Comment
Question by:evotsi
1 Comment
 
LVL 73

Accepted Solution

by:
sdstuber earned 500 total points
Comment Utility
yes, depending on which columns, if any, are constrained to be unique, the view may not be updateable.


plus, the view acts as a filter.  If a product does not have a corresponding row in the productcat table with account = 1 then that product won't show up in the view, so you won't be able to apply updates to it but you could against the base table
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now