Rule Engine / Conditions on database level
Dear KNIMErs,
still trying to find my way through working with databases without having to learn SQL (I am lazy as hell :wink: )
Here’s my question:
I have a table that holds two columns, let’s call them ID1 and ID2, see screenshot below
I have a set of rules that define, what type of (database) line item this is:
IF ID1 IS NOT MISSING and ID2 IS MISSING → then it’s a DELETE
IF ID1 IS MISSING AND ID2 IS NOT MISSING → then it’s an INSERT
IF ID1 IS NOT MISSING AND ID2 IS NOT MISSING → then it’s an UPDATE
I can easily define this locally in KNIME using a Rule Engine node (see screenshot below)
This (local) Rule Engine shows the mode appending a new column (which probably is not possible on database level).
What I want to do instead is
if the type is DELETE use ID_1
if the type is INSERT use ID_2
if the type is UPDATE use ID_2
Is such a “set of rules” possible on database level as well? The reason I am asking is that I need to run this “query” daily and I somehow want to avoid to download 20 million lines just to throw 99.9% away.
Can you help me stay lazy? :smile:
Thanks a lot in advance.