dating people on - Updating a join view oracle


updating a join view oracle-81

As far as the user is concerned, the view looks just like a table.

The following Transact-SQL statement selects all the data for the view shown in Listing 9.1, sorting the result set on the Company Name column: statement wouldn't have to change. Company Name Views are created inside individual databases, however, views can reference tables and views in other databases or even on other servers (if the view is defined using distributed queries).

Assuming you're not breaking the rules for updateable views, then you should be okay.

Typically, it does a good job with this, so the update view plan may look very similar to a plan for a simple update to the single affected base table. Then read this blog I wrote recently to see how it could be affected.

id Data, -- PK of main table tab Data fi SL, fi Model, fi Claim Status -- FK to dim Claim Status FROM tab Data AS d INNER JOIN loc SL AS sl ON SL = SL INNER JOIN loc GSP AS gsp ON GSP = GSP INNER JOIN loc Country AS c ON Country = Country INNER JOIN loc Market Unit AS mu ON Market Unit = Market Unit INNER JOIN mod Model AS m ON Model = Model INNER JOIN dim Claim Status AS s ON Claim Status = Claim Status INNER JOIN tdef Product Type ON Product Type = tdef Product Product Type LEFT OUTER JOIN tdef Service Level ON d.fimax Service Level = tdef Service Service Level LEFT OUTER JOIN tdef Action Code AS ac ON d.fimax Action Code = Action Code UPDATE tab Data SET fi Claim Status = (SELECT id Claim Status FROM dim Claim Status WHERE Claim Status Name = 'Awaiting auth.') WHERE fi Claim Status=(SELECT id Claim Status FROM dim Claim Status WHERE Claim Status Name = 'Approved') updatable in practice, due to limitations of the query processor's reasoning.