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: 
APelmus
Contributor
Contributor

ETL that reads select query from inside a column and inserts the resulted rows into another table

Hello everybody,

  • I am a beginner with Talend and this might be very easy to do, but for me seems a little bit complicated, so I would appreciate your help.
  • I have a table (TABLE A) that contains a column in which different queries are stored. For every row from that table, the column named 'query' contains a select statement.
  • Each of these queries selects same kind of columns (so the table resulted for each of the query looks similar (same number of columns and same type of data)
  • I need to read the data resulted from running the select statement from within the column 'query' of the TABLE A and insert them into TABLE B.
  • Table B's columns are the same as the columns from the select statements.
  • I think i need to select the query column from the TABLE A and then create a context for that column and next to somehow read the data using the context and insert it into TABLE B but i don't know what kind of components I should use.

Thank you!

Andreea

Labels (2)
2 Replies
BenG
Partner - Contributor III
Partner - Contributor III

Hi Andreea,

 

I hope I understood it correctly, I just made my own example.

 

I have created a table "Queries" that contains in one column the queries

0695b00000dc0XCAAY.png 

Then I have a table "Table A" with the values I query.

0695b00000dc0WoAAI.png 

The Job design looks like this

0695b00000dc0a1AAA.pngI load the table with the queries, the tMap_2 is just assign the field to the next component (if you would have more fields in the query table) after that its going into a tFlowToIterate and then to the table which contains the data you want to query. The rest is easy just another tMap to Map the fields and then a tUnite to unite the data into one stream into TableB.

 

Here is the important stuff on the query config in TableA (you need to assign the variable from the tFlowToIterate component:0695b00000dc0dyAAA.png 

I hope that is what you were looking for.

 

Cheers

Ben

 

 

 

APelmus
Contributor
Contributor
Author

Thank you very much!