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:

  1. Drag the customer table from the left-hand side panel. This will open up a list of options.
  2. Select tMysqlInput.
  3. Add a tLogRow component and create a flow between tMysqlInput and tLogRow. Change the Mode of tLogRow to table.
  4. 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:

  1. 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.