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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
PD2
Contributor
Contributor

Parameterized queries, how to do them.

I have been working with Talend 5.4.x for about 3 weeks now, awesome tool.
I have the need to execute a query that will return to me a result set of rows containing (person id, person name, person address, person invoice) for several hundred row per week.
I would like to then use the data from the result set in "where" clauses of 12 additional queries in order to create 12 data files for a customer.
I am use to using parameterized queries where a "?" is used as a place holder for a prepared select statement.
How do I accomplish something similar to parameterized queries in Talend? At a minimum I figure each of the 12 data file queries would be a subjob.
Thoughts?
Thanks
Peter
Labels (2)
7 Replies
Anonymous
Not applicable

Hi,
From your requirement, please check the component TalendHelpCenter:tMysqlRow with related scenario.
Best regards
Sabrina
Anonymous
Not applicable

Dear Peter,
If I'm not wrong you want to use the results of your main query as a sub query resultset / condition to your 12 additional queries?
Why don't you use tMap and try joining your main query and to these 12 different queries?
You can also store your main query result in tHashMap (input and output) components, kind of temporary table.
Parameterised query is possible assigning variables to your query component, so if you are talking about 100 rows from your main query, then you are bound to iterate 100 times to get your result?
Hope this helps.
G
Anonymous
Not applicable

you could also:
tMysqlRow
-> tFlowToIterate
-> tMysqlRow (with parameter from 1st query)
-> tOutputFile***
PD2
Contributor
Contributor
Author

Dear Peter,
If I'm not wrong you want to use the results of your main query as a sub query resultset / condition to your 12 additional queries?
Why don't you use tMap and try joining your main query and to these 12 different queries?
You can also store your main query result in tHashMap (input and output) components, kind of temporary table.
Parameterised query is possible assigning variables to your query component, so if you are talking about 100 rows from your main query, then you are bound to iterate 100 times to get your result?
Hope this helps.
G

G,
I don't disagree with your idea but I am porting the SQL from Pentaho and I would rather let the database crank on the complicated SQL (SQL with outer joins, SQL subselects with outer joins on numerous table etc..).
I have and extensive SQL back round and I would rather let the SQL/Database do the work than try to do manipulations in Talend/Java.
Thanks
Peter
PD2
Contributor
Contributor
Author

Well I have my parameterized parameterized
_AnonymousUser
Specialist III
Specialist III

Hi,
I have a parametrized query to be used for tpostgressqlInput component.Can anyone please help me in this regard.
Anonymous
Not applicable

Hi Anj,
What does your parametrized query look like?
Best regards
Sabrina