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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
SNawaz1631552848
Contributor
Contributor

tExtractJSONFields to DBInput

hi,

I am a Newbie to Talend. I am trying to reach data from Kafka in JSON format, extracting the JSON values using tExtractJSONFields. I was able to do till this point. After that I am trying to pass the value from tExtractJSONFields to DBInput as a variable that can be used in a SQL Query that will fetch data from SQL Server.

But I am not able to get the variable name to pass it to the query in DBInput.

"

select name

,address

from

employees

where

emp_id

=

'"

+

(String)globalMap.get("row1.emp_id")

+

"'"

Can you please help on how to achieve this?

Labels (5)
1 Solution

Accepted Solutions
Anonymous
Not applicable

Hi

Using a tFlowToIterate to iterate each value extracted from tExtractJSONFields. eg:

....tExtractJSONFields..row1-->tFlowToTerate--iterate--tDBInput..>

"

select name

,address

from

employees

where

emp_id

=

'"

+

(String)globalMap.get("row1.emp_id")

+

"'"

 

// row1 is row name after tExtractJSONFields

 

Please try again and let me know if it works.

 

Regards

Shong

View solution in original post

2 Replies
Anonymous
Not applicable

Hi

Using a tFlowToIterate to iterate each value extracted from tExtractJSONFields. eg:

....tExtractJSONFields..row1-->tFlowToTerate--iterate--tDBInput..>

"

select name

,address

from

employees

where

emp_id

=

'"

+

(String)globalMap.get("row1.emp_id")

+

"'"

 

// row1 is row name after tExtractJSONFields

 

Please try again and let me know if it works.

 

Regards

Shong

SNawaz1631552848
Contributor
Contributor
Author

Yes. It worked. Thank you