Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Mehdi_Mhedhbi2
Contributor III
Contributor III

passing context to tOracleInput

Hello, I'm having three identical databases with the same schema (tables and columns) which means one DB per country. Example: the table customer exists in the 3 databases with the same fields. Only the content is different because every country has its own clients. I want to merge the 3 tables in a single table at the destination. Normally I would use three tOracleInput. Then add a value to indicate the country name in a tamp for each of the 3 countries and then concatenate all in a tUnite.

0683p000009M815.png
But since the 3 databases have the exactly same architecture,I want to do it in one single tOracleInput and execute the same sql statement "select code, nom from the customer" but on 3 different databases. I thought about using context variable and tLoop but I am having problems to correctly design a functional job.

 

Labels (3)
1 Reply
TRF
Champion II
Champion II

You may try but the final cost will be the same. The advantage of if design is in case the number of country and input database may grow up.
Well, for each element required to establish the connection with the source database, you need to enumerate the value into the appropriate context variable. For example, for OracleUsername the value must be user1;user2;user2 and so on for every variable (password, host, etc.)
Then using a tLoop you have to extract value[1], value[2], ..., value[n] for each variable (this may be done using a tJava) to populate a global or context variable used into your tOracleInput component.
The design should look like this:
tLoop--(iterate)-->tJava--(onComponentOK)-->tOracleInput---->tOracleOutput