How to do condition when inserting records in Database

Hi All,

I have a source database. I am currently using ETL to run queries and extract information from my source record, I also do some reformatting in the middle to get my desired output.

What I want is I want to insert my reformatted output to my applications database (Target). Before inserting i have to check if the data already exist or not and then if it exists then take the id from the database and then mapp this id against another table which is users table.

Can you please tell me how to do this using Clover ETL.

Hello,
it can be done with DBJoin component:
graphDBJoin.png

Hi Agata,

Thanks for the quick response. Just one question around DBJoin and the last steps you have show in the graph. Is it basically joining the record and if the record does not exist then is it inserting the records or how does it work.

Thanks and appreciate all your help.

Naveen

Hello Naveen,
as described in Documentation: The joined data is then sent to the first output port. The second output port can optionally be used to capture unmatched master records. That means that the 2nd DBOutputTable (“New data”) inserts new records to the database table. DBJoIn just finds existing and non-existing records and sends them downstream. More over you can transform records obtained from database.