Reading from database tables
Now that we have the Talend schemas available, we can start to use them to access the data in the database.
Getting ready
Create a job jo_cook_ch07_0010_readTables
.
How to do it…
The default mode of reading a table in Talend is to read all the rows and columns of a table:
- Drag the
customer
table from the left-hand side panel. This will open up a list of options. - Select tMysqlInput.
- Add a
tLogRow
component and create a flow betweentMysqlInput
andtLogRow
. Change the Mode oftLogRow
to table. - Run the job and you will see that the complete table has been read.
Selected rows and columns
In many cases we do not want the whole table, so it is more efficient to filter the data in the database via a query:
- Open
tMysqlInput
and change ...
Get Talend Open Studio Cookbook now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.