Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
,addressfrom
employeeswhere
emp_id=
'"+
(String)globalMap.get("row1.emp_id")+
"'"Can you please help on how to achieve this?
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
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