Select Categories Below
Advertisement
Start Your Own Q&A Site
Create your own Q&A site easily, allowing you to quickly grow a new community around any subject matter or generate new organic traffic for your existing website.
Status: Open Points: 125 Time: 04:02 - Jul 05, 2010
MURIUKI4
THIS IS IN ORACLE DB I HAVE TABLE WITH CORRECT DATA AND THE OTHER WRONG DATA I WANT TO UPDATE FROM TABLE A TO B
Categories:
Add Categories
When adding more than one category, separate them with commas.
Suleman
Date:: Jul 16, 2010
Time:: 10:02
Hi MuriUK, Use this to get the correct data fill in from table A to table B. this takes care of the exsisting but incorrect records by updating those rows with values from table A and the non-exsisting records in table B by inserting those rows from table A. MERGE INTO B USING A ON (B.id = A.id) WHEN MATCHED THEN UPDATE SET B_col1 = A_col1, B_col2 = A_col2, B_col3 = A_col3, B_col4 = A_col4 WHEN NOT MATCHED THEN INSERT (B_col1,B_col2,B_col3,B_col4) VALUES (A_col1,A_col2,A_col3,A_col4); Hope this helps.
anjith_ts
Date:: Mar 10, 2011
Time:: 01:27
A, If you are sure that ,the two tables must contain same data ,then you can truncate the wrong data table and insert the data to it from the correct table by Tuncate table <wrong_table> insert into table <wrong_table> select * from <correct_table>; B, If you simply want to insert the data,which is not in wrong table you can use the sql provided by Suleman
Answer this Question
New User
Email:
Upon submission of this form, you will automatically be registered as a Quomon user and we will send your login information to this address
Registered User
Username:
Password:
Forgot Your Password?
Enter your email address below and we will resend your login information to you.
Login Information Sent
Questions
how to update data using different table
How to Update records of one oracle table from another table when there may b...
how to export data oracle to sqlserver
ORACLE UPDATE QUERY
about of oracle connectivity from front end
You have 100 characters to use
Rank
Expert
Points
1.
10354
2.
6493
3.
5596
4.
4848
5.
3487
6.
2840
7.
2770
8.
2303
9.
1820
10.
917
Register today to share your knowledge with the community and be recognized and rewarded for your contributions.
Register Here
"Psst, Quomon is a great site. Pass it on." Tell a Friend | Link To Us | Save to Delicious | Digg it
Language Options
English:
Español:
Sponsors
Questions and Answers Software