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

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Passing a global Map variable in the schema name.

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.

 

 

0683p000009M2Kv.jpg

0683p000009M2cg.jpg

 

It should be getting the value = flcbmtg.  Can you please help me on this?

 

0683p000009M2tG.jpg

Labels (2)
5 Replies
Anonymous
Not applicable
Author

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"))

 

Anonymous
Not applicable
Author

Thank you...

But I'm still getting this error.  Is it possible that it cannot process the schema that global map variable is getting?

 

0683p000009M2tQ.jpg

Anonymous
Not applicable
Author

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.

Anonymous
Not applicable
Author

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

Anonymous
Not applicable
Author

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.