Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Jedi-Habs
Contributor
Contributor

How to merge data from two databases with same schema using looping?

Hi,

I have a situation where there will be two PROD databases running in parallel for some time before the old version is decommissioned. Warehouses will be gradually moved over from one database in to another but at a time, a warehouse will be connecting to only to one database. So till all the warehouses are moved from the old to the new data base we will have both of them running in parallel. Both these data bases have the same schema but different passwords.

I have a .csv file which has the db information as shown below. The "Y" s at the end indicate which password it has to pick from the context file

RP_DRP_AdditionalParams|RP_DRP_Port|RP_DRP_Schema|RP_DRP_Server|RP_DRP_Database|RP_DRP_Password1|RP_DRP_Password2

|1433|talend|tstddrpDB01|FWD|Y|

|1433|talend|tstdrpSQL1|FWD||Y

My context file is specified as below.

0693p00000AEBq3AAH.png

My looping mechanism for two databases is a joblet designed as below.

0693p00000AEBq8AAH.png

But when I run a job with the joblet in it, I am getting the following errors.

0693p00000AEBqIAAX.pngAny ideas how I can get this resolved? Thanks.

Habs

2 Replies
JohnRMK
Creator II
Creator II

You forget a ; in the else if condition

Jedi-Habs
Contributor
Contributor
Author

Thanks John. After positing the issue here, I was able to get this resolved. First the whole 'if' clause needs to be in brackets it seems. Second, the entries in "read_cred" (main) were wrong. Once I fixed these two, it worked. Thanks for your input anyways.