Updating multiple tables in oracle

I've written the syntax below like I would have written this in MS SQL, but I know Oracle has a different syntax for this. Just a slight modification to the SET clause at line 2 and parenthesis needed around the subquery.

UPDATE u Lat SET (ULAT.enrollment Status, seat Allocation ID) = (SELECT 'I', null FROM dr Learning Activity Transcript u Lat inner join dr Learning Activity Instance LAI on ulat.learning Activity Instance ID=ulat.learning Activ ity Instance ID where IN (select from dr Learning Activity Transcript lat inner join dr Learning Activity Instance Lai on lai.id=lat.learning Activity Instance ID where enrollmentstatus in ('E','W') and first MEeting STart cmerry, You're awesome... If I need to update a column and my underlying query has only one table, I don't need a subselect (unless of course the value comes from a subselect).

The update query below shows that the PICTURE column is updated by looking up the same ID value in CATEGORY_ID column in table Categories_Test and Categories. If you need to update multiple columns simultaneously, use comma to separate each column after the SET keyword. Here we only want to update PICTURE column in Categories_Test table where the data in Category_Name column is Seafood in table Categories. Software and hardware names mentioned on this site are registered trademarks of their respective companies.

Basically I would like to put together a query that updates a number of columns to replace actual data with test data.Suppose we have two tables Categories and Categories_Test. The common column in the two tables is CATEGORY_ID. Please note that query below is used for illustration purpose because Category_ID alone is primary key.We are going to update column DESCRIPTION and PICTURE in table Categories_Test by using data in table Categories, based on data in the common column CATEGORY_ID. Update data in a column in table A based on a common column in table B. Update data in two columns in table A based on a common column in table B. Conditionally update data in table A based on a common column in table B. No portion may be reproduced without my written permission.Hi, I have a file to JDBC scenario in which i have to update multiple table in a oracle database.I have put different statements in my message for different target tables .( Client number is consist of branch, Number, Sub Number Currency Code ) We have one big transaction table around 1 million records, having many columns, and at many places client numbers are stored from account master under various columns 1. You told me to use update ( select old.old_account_number, new.new_account_number from old_table old, mapping_table new where old.old_account_number = new.old_account_number ) set old_account_number = new_account_number; But I think my questions still reamin unanswered 1. In your answer only one number say client number will get updated.

You must have an account to comment. Please register or login here!