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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to pass prepared parameter in sql query in talend

i have an sql query followed by another sql query.
how to pass the output of 1 to the input of 2 .

I have used tdbinput followed by tdbrow. Its not working 
My first query :"SELECT * FROM a WHERE STAGING_STATUS='N' AND ROWNUM <= 1 order by created_date asc"



SECOND QUERY :
"SELECT
A.ID,
A.RECEIVED_DATE,
A.FILE_NAME,
B.ID AS TXN_ID,
B.MERCHANT_NUMBER,
B.TXN_DATE,
B.TXN_TIME,
B.TXN_CURRENCY_CODE,
B.TXN_VALUE,
B.TXN_TYPE,
B.RETAILER_REFERENCE
FROM ABC A ,
BCD B
WHERE A.ID=B.HDR_ID
AND A.ID = ?"

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi,

 

     Could you please try the below method where the output of the first method will be used as the input for second?

 

0683p000009M0an.png

 

The tFlowtoiterate component will be as shown below which means id column from first query will be passed as a value in iterative fashion.

0683p000009M0iL.png

 

 

     In the second query, after your current query, add a + and give Control+Space. It will show the list of available variables. Please select the variable shown below (the output variable from first query)

0683p000009M0iQ.png

 

 

 

Once its selected, you will see the query similar to below screenshot.

0683p000009M0ia.png

 

 

I believe this should resolve your issue. If the answer has helped you, could you please mark the topic as resolved? Kudos are also welcome 🙂

 

Warm Regards,

 

Nikhil Thampi

 

 

View solution in original post

5 Replies
Anonymous
Not applicable
Author

Hi,

 

     Could you please try the below method where the output of the first method will be used as the input for second?

 

0683p000009M0an.png

 

The tFlowtoiterate component will be as shown below which means id column from first query will be passed as a value in iterative fashion.

0683p000009M0iL.png

 

 

     In the second query, after your current query, add a + and give Control+Space. It will show the list of available variables. Please select the variable shown below (the output variable from first query)

0683p000009M0iQ.png

 

 

 

Once its selected, you will see the query similar to below screenshot.

0683p000009M0ia.png

 

 

I believe this should resolve your issue. If the answer has helped you, could you please mark the topic as resolved? Kudos are also welcome 🙂

 

Warm Regards,

 

Nikhil Thampi

 

 

Anonymous
Not applicable
Author

Hi ,
thanks for ur detailed explanation . i have done the same bt after last log pallete,nothing is getting printed in logs .Can u suggest why ?

Anonymous
Not applicable
Author

Hi,

 

     Could you please print and see whether variable of tflowtoiterate is having data? Could you please share your job and component details so that I will get more idea about the flow?

 

Warm Regards,

 

Nikhil Thampi

Anonymous
Not applicable
Author

Hi nikhil,
in the tdbinput what should we specify in the table name textbox in case of queries where there is a join of 2 or more tables? 

Anonymous
Not applicable
Author

Hi,

 

     You can add either one of the two tables in the table name text box. But please note that you will have to provide the query by yourself in the query area of the component.

 

Warm Regards,

 

Nikhil Thampi