Find out which records are different between two tables

Hi all,

I’m looking for a node that compares the content of two tables (current table and original table) with same structure and primary key. The result should be a new table containing all the records of current table and those of the original table that are no longer present in current table, all with an additional status field indicating the record status (identical, new, changed or deleted).

Example:

Original table contains following records (col1 and col2 contain the primary key)

col1     col2     col3     col4
-------- -------- -------- --------
1        a        12       24
1        b        45       1
2        s        37       32

Current table contains following records (col1 and col2 contain the primary key)

col1     col2     col3     col4
-------- -------- -------- --------
1        a        12       28
1        b        45       1
2        a        91       2

The resulting table should be as follows:

col1     col2     col3     col4     status
-------- -------- -------- -------- ---------
1        a        12       28       changed
1        b        45       1        identical
2        a        91       2        new
2        s        37       32       deleted

Thanks in advance for your help.

Marco