Updating multiple tables in oracle tomboy personality dating

Posted by / 03-Sep-2017 10:11

Updating multiple tables in oracle

Oracle is expecting the SET keyword straight after the one and only one table name.

I think you will need to do something like this: UPDATE carts c SET c.format_code = (SELECT DISTINCT p.format_code FROM prices p WHERE p.item_id = c.cart_item_id) It is important that the SELECT statement returns You are getting ORA-01779 because "(select P.cart_item as New_Cart_Item , C.cart_item as Old_Cart_Item from prices P, carts C where P.cart_item = C.cart_item and BLAH BLAH BLAH)" is not a "key-preserved" view.

What I'm trying to do is something I do regularly in MS SQL Server.

It would look like: UPDATE carts c SET c.format_code = (select p.format_code from PRICES p where C.table_key = P.table_key) WHERE c.cart_item_id IN (SELECT t.cart_item_id from prices r, carts t WHERE r.You just want to do this multiple times as specified in the where clause: UPDATE carts c SET c.format_code = (*single value*) WHERE c.cart_item_id IN (SELECT t.cart_item_id from prices r, carts t WHERE r.AND blah blah blah.....) Now the question is HOW to deliver a single value from PRICES table.What you propose only works if I want to update all rows in the table being updated to the same value in all the other tables.Also, creating views of this data isn't really applicable.

updating multiple tables in oracle-28updating multiple tables in oracle-81updating multiple tables in oracle-80

maybe i am missing something but it seems to me quite easy to do what u want updating multiple columns: SQL Server: Update table Set t.column1 = a.column1, t.column2 = b.column2 From table t, table_a a, table_b b Where t.table_id = a.table_id and a.table_id = b.table_id Oracle: UPDATE table t SET (t.column1, t.column2) = ( SELECT a.column1, b.column2 FROM table_a a, table_b b WHERE t.table_id = a.table_id AND a.table_id = b.table_id ) WHERE EXISTS (SELECT 1 FROM table_a a, table_b b WHERE t.table_id = a.table_id AND a.table_id = b.table_id ) / Should work achieving all your goals (multiple columns update in multiple rows and corelation between tables) jhdaniel, "it only allows me to update a single row at a time" You can update as many rows as you like with the one update statement.

One thought on “updating multiple tables in oracle”