DATA-INTEGRATION-DEVELOPER practice question 5 of 15

You have a MySQL table named customers with column named id, address, and country. You need to retrieve records that have a specific based on a variable. Which steps should you use to achieve this?

Full set: 55 questions
Answer options
A: Use a tDBInput component with a context variable in the SQL query. Correct answer
B: Use a tDBInput component with a Run fi trigger.
C: Use a tDBInput component and link to a tMatchGroup component.
D: Use a tDBInput component and link it to a tFilterColumns component.
Correct Answer:
A. Use a tDBInput component with a context variable in the SQL query.
Explanation

The most efficient and standard method to filter database records based on a dynamic value is to parameterize the SQL query directly within the tDBInput component. This is achieved by embedding a context variable in the WHERE clause of the query. This approach leverages the database engine to perform the filtering, which minimizes data transfer and processing within the Talend job itself, leading to better performance.

Why Incorrect

B. A Run if trigger controls the execution flow between subjobs or components; it does not filter data rows retrieved by a query.
C. The tMatchGroup component is used for data deduplication and identifying matching records, not for simple row filtering based on a variable.
D. The tFilterColumns component is used to remove entire columns from a data flow, not to filter rows based on their values.

References

1. Talend, Inc. (2023). Talend Studio User Guide, 8.0. "Using variables in a Job". This section explains how to incorporate context variables into component properties, including SQL queries.

2. Talend, Inc. (2023). Talend Components Reference Guide, 8.0. "tMysqlInput". The documentation for database input components provides examples of using context variables within the SQL query's WHERE clause for dynamic data retrieval.

Scroll to Top