Quick dating
Custom Menu
  • dating a lady older than you
  • dating russian partners
  • NEWS
    Porn culture has infiltrated every facet of our lives, breaking free from the confines of specialist DVD shops.


    Updating two tables in oracle

    UPDATE dest_tab tt SET (tt.code, tt.description) = (SELECT st.code, st.description FROM source_tab st WHERE = tt.id) WHERE EXISTS (SELECT 1 FROM source_tab WHERE id = tt.id); 5000 rows updated.

    SQL ----------------------------------------------------------------------------------------------- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | ----------------------------------------------------------------------------------------------- | 0 | UPDATE STATEMENT | | 4999 | 185K| 30013 (34)| | | 1 | UPDATE | dest_tab | | | | | | 2 | NESTED LOOPS SEMI | | 4999 | 185K| 19 (6)| | | 3 | TABLE ACCESS FULL | dest_tab | 10000 | 332K| 18 (0)| | |* 4 | INDEX UNIQUE SCAN | source_tab_PK | 2500 | 10000 | 0 (0)| | | 5 | TABLE ACCESS BY INDEX ROWID| source_tab | 1 | 43 | 2 (0)| | |* 6 | INDEX UNIQUE SCAN | source_tab_PK | 1 | | 1 (0)| | ----------------------------------------------------------------------------------------------- Predicate Information (identified by operation id): --------------------------------------------------- 4 - access("ID"="TT"."ID") 6 - access("ST"."ID"=: B1) UPDATE (SELECT tt.id, tt.code, tt.description, AS st_code, st.description AS st_description FROM dest_tab tt, source_tab st WHERE = st.id) ilv SET = ilv.st_code, ilv.description = ilv.st_description; 5000 rows updated.

    But Sales Supplier, Purchase supplier, Wholesale Supplier ..many other columns how can i update in single SQL ( I have to update around 70 columns and some columns may have null values such as Purchase supplier ..) 2. You need to have the table you are updating from have a unique or primary key constraint.

    Secondly you have shown me to update table with "KEY PRESERVED" method. IT NEEDS THIS LOGICALLY regardless of the method used, so just add it (for if a row in OLD joins to more than one row in NEW -- you are hosed, you cannot update this data, therefore NEW has a unique/primary key, add it to facilitate the update) I had a similiar query and i tried applying to my tables.

    updating two tables in oracle-82

    I want to write SQL ( not PL/SQL ) to update transaction table from mapping table at one stroke. regards & thanks pjp update ( select old.old_account_number, new.new_account_number from old_table old, mapping_table new where old.old_account_number = new.new_account_number ) set old_account_number = new_account_number; disabling foreign keys during the operation and enabling them afterward. 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; (ie in the subquery, match the old account numbers not try matching the old in the old table to the new in the mapping table) Of course if the original posting had the CREATEs/INSERTS etc, it would have a quick and east test. I have to update a transaction table where mapping is existing with old account no and new account number. etc I have a mapping table where "ALL" old account number and new account numbers are present. Doing a 'join update' in Oracle can sometime cause a few headaches.By 'join update' I mean the situation where we have two tables and want to update some of the rows in the first table based on values that exist in the second table.

    Leave a Reply


    Pages: [1] 2 3 4 5 6 | Next | Last


    




    Copyright © 2017 - meova.72vanni.ru