The database support allows you to read and write from databases using a map. To use the database support, you must first import the database using the Import mechanism (File -> Import) in the studio. This reads all of the tables of the database into a set of structures, one for each table. Each database structure has a loop (with an element called Row) that corresponds to each selected or written row.
Table of Contents
To READ FROM THE DATABASE, use the structure corresponding to the table as the input structure of a map. If you are reading from multiple tables using a database join , you can create a new structure representing the joined tables using the New Structure wizard (select the create a database join table option).
If you would like to Enrich your career with a Talend certified professional, then visit Mindmajix - A Global online training platform: “Talend Course” . This course will help you to achieve excellence in this domain.
When creating the map, you can specify a SQL select statement using a DatabaseSelect function. You can also use DatabaseJoin function(s) to specify conditions on join(s) as required. All database functions are placed in the IO/Database expression tab.
To write to a database, use a structure corresponding to the table as the output structure of a map. Use a DatabaseInsert or DatabaseUpdate function as required.
-------- Related Page: Talend Database Tutorial --------
You can read from or write to any number of database tables in a single map by creating an enclosing structure that inherits from the desired database table structures.Lookup functions are also provided to find and update values from database tables.
When a database is imported, two structures are created for each table in the following categories (each represented by a folder):
When reading a table from a database, use the structure in the Tables as the input to your map. By default, it will read all of the rows from the table. If you wish to select less than that, use the DatabaseSelect on the root element of the table (the element about the Row element).
Frequently Asked TALEND Interview Questions & Answers
If you wish to read multiple unrelated tables (in the same or different databases) as an input to a map, create an enclosing structure with an element for each table to read. And in each table element, inherit from the Tables structure and then specify the DatabaseSelect as usual.
To write to a database, use the structure in Tables. You can either insert new rows into the database or update rows which are already present. When updating, it will find the row to update by the primary key column(s) specified for the table (which is normally detected in the database import).
You can insert into or update multiple tables in the output of the map by inheriting from the structure in Tables to insert/update. Then specify the DatabaseInsert or DatabaseUpdate function as required at the root element of the Tables structure, which is the element that is the parent of the Row element.
Our work-support plans provide precise options as per your project tasks. Whether you are a newbie or an experienced professional seeking assistance in completing project tasks, we are here with the following plans to meet your custom needs:
Name | Dates | |
---|---|---|
Talend Training | Dec 24 to Jan 08 | View Details |
Talend Training | Dec 28 to Jan 12 | View Details |
Talend Training | Dec 31 to Jan 15 | View Details |
Talend Training | Jan 04 to Jan 19 | View Details |
Yamuna Karumuri is a content writer at Mindmajix.com. Her passion lies in writing articles on IT platforms including Machine learning, PowerShell, DevOps, Data Science, Artificial Intelligence, Selenium, MSBI, and so on. You can connect with her via LinkedIn.