Quick Search:
 
 Oracle PL/SQL: UPDATE: Update Object Table Jump to:  
Category: >> Oracle PL/SQL >> UPDATE: Update Object Table  

<< lastnext >>

Snippet Name: UPDATE: Update Object Table

Description: You can update, insert, and delete the data in an object view using the same SQL DML you use for object tables. Oracle updates the base tables of the object view if there is no ambiguity.

A view is not updatable if its view query contains joins, set operators, aggregate functions, GROUP BY, or DISTINCT. If a view query contains pseudocolumns or expressions, the corresponding view columns are not updatable. Object views often involve joins.

Also see:
» UPDATE: Update a partitioned table
» UPDATE: Update based on a record
» UPDATE: with RETURNING clause
» UPDATE: Nested Table Update example
» UPDATE: Correlated Update
» UPDATE: Update from a SELECT statement
» UPDATE: based on multiple returned val...
» UPDATE: Update based on a query
» UPDATE: Update multiple rows
» UPDATE: update a specific record
» UPDATE: Single row
» UPDATE

Comment: (none)

Language: PL/SQL
Highlight Mode: PHP
Last Modified: March 04th, 2009

UPDATE <table_name> <alias>
SET VALUE (<alias>) = (
  <SELECT statement>)
WHERE <column_name> <condition> <value>;
 
 
CREATE TABLE people_demo1 OF people_typ;
 
CREATE TABLE people_demo2 OF people_typ;
 
UPDATE people_demo1 p SET VALUE(p) =
   (SELECT VALUE(q) FROM people_demo2 q
    WHERE p.department_id = q.department_id)
   WHERE p.department_id = 10;
 
-- The example uses the VALUE object reference FUNCTION 
-- in both the SET clause and the subquery.


 
   Home |    Search |    Code Library |    Sponsors |    Privacy |    Terms of Use |    Contact Us © 2003 - 2024 psoug.org