Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Compare two identical tables and to report only column values that has changed

3250950Jun 8 2016 — edited Jun 26 2016

Can someone please help on a code which will compare each column in 2 similar structured (similar data as well and one tend to change wherein I need to capture that change) oracle tables and to result in only row numbers, column name (which got updated), old value, new value. Like below. I am quite new to Oracle and so please share the code.

RNUM         CNAME               OLD_VAL                      NEW_VAL

------------    -------------------- ------------------------------ -----------------------------

     1               ENAME                Name11                         Name1

     1               HIREDATE          13-may-2011                  13-may-2001

     3               ENAME                Name32                         Name3

     3               HIREDATE          13-jul-2011                     13-jul-2001

     4               DESIGNATION    SENIOR ANALYST        ANALYST

     5               SALARY              10000                              5000

This post has been answered by alvinder on Jun 9 2016
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 24 2016
Added on Jun 8 2016
40 comments
6,522 views