Quick Search:
CODE
Oracle PL/SQL Code Library
JOBS
Find Or Post Oracle Jobs
FORUM
Oracle Discussion & Chat
 Oracle PL/SQL: UPDATE: Update based on a record Jump to:  
Category: >> Oracle PL/SQL >> UPDATE: Update based on a record Bookmark and Share

<< lastnext >>

Snippet Name: UPDATE: Update based on a record

Description: Update a table based on the value or presence of a record.

Also see:
» UPDATE: Update a partitioned table
» UPDATE: Update Object Table
» 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: PLSQL
Last Modified: March 04th, 2009

UPDATE <table_name>
SET ROW = <record_name>
WHERE <column_name> <condition> <value>;
 
CREATE TABLE my_table AS
SELECT table_name, tablespace_name
FROM all_tables;
 
SELECT DISTINCT tablespace_name
FROM my_table;
 
DECLARE
 trec  my_table%ROWTYPE;
BEGIN
  trec.table_name := 'DUAL';
  trec.tablespace_name := 'NEW_TBSP';
 
  UPDATE my_table
  SET ROW = trec
  WHERE table_name = 'DUAL';
 
  COMMIT;
END;
/
 
SELECT DISTINCT tablespace_name
FROM my_table;


Free
Oracle Magazine
Subscriptions
and Oracle White Papers


SQL University.net courses meet the most demanding needs of the business world for advanced education in a cost-effective manner. SQL University.net courses are available immediately for IT professionals and can be taken without disruption of your workplace schedule or processes.

Compared to traditional travel-based training, SQL University.net saves time and valuable corporate resources, allowing companies to do more with less. That's our mission, and that's what we deliver.

Click here to find out more
 
Home      :      Code Library      :      Sponsors      :      Privacy      :      Terms of Use      :      Contact Us 241 users online    © 2009 psoug.org

PSOUG LOGIN
Username: 
Password: 
Forgot your password?