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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Reserved word in my postgres query throws an error in tPostgresqlRow

Hi,

 

I'm very new on Talend Open Studio for Data Integration version 7.  I have a query that throws an error.  How do you resolved reserved words in the query that runs throus tPostgresqlRow?

 

Select "current_schema", src_id from src_table

 

Thanks in advance!

Labels (2)
3 Replies
Anonymous
Not applicable
Author

You need to escape the double quotes that you use to escape the reserved words. So, something like this....

"Select \"current_schema\", src_id from src_table"

The reason for this is that the queries used in Talend are actually Java Strings. Java Strings are surrounded by double quotes. To include a double quote, you need to escape it with a \.

 

Anonymous
Not applicable
Author

Thank you...

 

I also have a followup question.  

 

0683p000009M2cu.jpg

In tDBInput_1, I select all current_schema and src_sys_id and pass it through tFlowtoIterate_1.  Then I have tDBInput_4 that selects my input table and use the current_schema from tDBInput_1.  Whenever I run this, it's always null. I'm going crazy figuring this out.

 

0683p000009M2r6.jpg

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