Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
Similar way, I would like to change the SQL query columns dynamically in talend. I am fetching the columns values from one file and I was trying to store those values in Context Variable. So for every iteration it will choose different value and it will change the SQL column in query. Later I would like to store output file system with the name of value which we have retrieved from variable i.e. <Variable_Value>.dat
Could you please help in this use case? or Did somebody try this scenario before?
Thank you
Hi @RakeshSelukar,
You can try below,
.
Please mark the topic as resolved if my answer helped you and Kudos are also welcome.
Regards,
Vibin CT.
can you please explain your question with input file and expected output ?
For example:
Input file contains
AMT1
AMT2
AMT3
Source Table: ABC (ID number, NAME varchar2(30), AMT1 number, AMT2, number, AMT3 number)
Expected query -
1st iteration: SELECT NAME, SUM(AMT1) from ABC where ID=(...) group by NAME;
2nd iteration: SELECT NAME, SUM(AMT2) from ABC where ID=(...) group by NAME;
3rd iteration: SELECT NAME, SUM(AMT3) from ABC where ID=(...) group by NAME;
In the above query I want use variable instead of "AMT[1-3]" so it will pickup the values of column from lookup file and it will generate query at runtime to produce output.
Thank you!!!
Hi @RakeshSelukar,
You can try below,
.
Please mark the topic as resolved if my answer helped you and Kudos are also welcome.
Regards,
Vibin CT.