Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I got null values when I passed a global map variable as a schema name in the query. Even though, there's a value that pass from tlogRow. Below is my job.
It should be getting the value = flcbmtg. Can you please help me on this?
There are a couple of things wrong where you use your globalMap. First of all, the tFlowToIterate names the globalMap key using the row that feeds it and the column name. The row that feeds it is row4 not row1. The other issue is that you will need to cast that value from Object. The globalMap will default all objects to Object. To do this, just use the following code....
((String)globalMap.get("row4.current_schema"))
Thank you...
But I'm still getting this error. Is it possible that it cannot process the schema that global map variable is getting?
OK, deactivate your DB component and everything after that. Add a tJava after the tFlowToIterate component. Then add your query String to the tJava and save it to a String variable. Then use a System.out.println() call to print that query to the output window. This will show you what is not working properly. If the output from this works in your DB query analyser, then it will work in Talend.
Thanks again.
I did put the global variable in TJavarow and its getting the schema that I need, it's just that when I replace it here:
FROM \""+context.tandem_Database+"\".\""+((String)globalMap.get("row4.current_schema"))+"\".\"party_contacts\"
It's reading it like null.party_contacts
Look at your previous error message and the error message you are getting for this. They are different. So the globalMap call change has done something. You need to know the SQL that is generated by that String manipulation and then test that SQL. If you try out what I suggested it will print the SQL that is generated so that you can test or see what is happening.