Joiner node in Loop

I built a workflow that does that also to play around with SQLite and to see what it could do.
I have two databases that both have two tables named “table_01” and “table_02”. They have the same structure Col1 … but two cells are different than the others. Task is now to isolate these cells and leave the ones out that are identical

I extract the structure from the table and build an reference string for a JOIN operation

This string can now be used to bring the two tables together after the ‘right’ table has been transferred temporarily to the first/left database.

Since SQLIte does not support RIGHT OUTER JOINS I used an inner JOIN and excluded the IDs that would be identical in all columns so the remaining ones are the ones we were looking for.

CREATE TABLE $${Stable_not_identical}$$ AS
_SELECT * FROM _
_temp_table t3
_WHERE t3.new_id NOT IN _
_( SELECT DISTINCT _
_t2.new_id _
_FROM _temp_table t2 _
INNER JOIN $${Sname}$$ t1
ON $${Scombined string}$$
)

The table with the non-identical rows from the right table is then stored in the first database (and might be transferred to a final location).

Maybe it is a bit of an overkill and your problem might have been solved in the meantime but it gave me the opportunity to demonstrate a few features of KNIME with Databases. One might switch out the SQLite with a bigger DB or might manipulate the construction of the SQL join code or something else.

Here are the left over non identical lines. If there is already an ID there one might drop the artificial one.

36

kn_example_right_joiner_loop_sqlite.knwf (151.5 KB)