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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to extract data from SQL Server and process row by row

Hi, all! Talend newbie here. I have data in an SQL Server database which I want to extract and process row by row. For each row, I want to perform a different action depending on the value of one field in the row (the same field each time). My current job so far has the following steps:

 

tMSSQLInput

main

tFlowToIterate

iterate

tJava

 

However, I now want to connect from tJava to tWriteJSONField using the runif connector but Talend won't allow that. Is there a way to do this, or a better way using different components? I'm not sure whether it should be tJava, tJavaRow, or something else altogether.

 

TIA,

 

Nick 

 

 

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi
tWriteJsonField requires an input component, so you can use tFixedFlowInput to generate the input data before tWriteJsonField.
eg
tMSSQLInput-main(row1)-->tFlowToIterate--iterate--tJava--oncomponentok--tFixedFlowInput--main--tWriteJsonField...
on tFixedFlowInput, you can get the input data which is extracted on tMssqlInput with expression like:

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


Regards
Shong

View solution in original post

2 Replies
Anonymous
Not applicable
Author

Hi
tWriteJsonField requires an input component, so you can use tFixedFlowInput to generate the input data before tWriteJsonField.
eg
tMSSQLInput-main(row1)-->tFlowToIterate--iterate--tJava--oncomponentok--tFixedFlowInput--main--tWriteJsonField...
on tFixedFlowInput, you can get the input data which is extracted on tMssqlInput with expression like:

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


Regards
Shong

Anonymous
Not applicable
Author

Many thanks, worked perfectly!