Tutorial Talend
En suivant ces illustrations, vous aurez en mesure de créer un premier projet sous Talend permettant le chargement des données à partir d’une table Access et d’un fichier délimité vers une table oracle. Durant ce projet, on utilise un fichier délimité par virgule nommé source.txt. Voici sa structure : 1,rachid,benhocine,paris 2,rachid,benhocine,paris 3,rachid,benhocine,paris Une table access nommé client. Voici sa structure
Une table oracle nommée test dont voici sa structure SQL> desc test Nom NULL ? Type ----------------------------------------- -------- ---------------CODE VARCHAR2(20) NOM VARCHAR2(20) PRENOM VARCHAR2(20) ADR VARCHAR2(20) SQL> Démarrer Talend.
Click create to create a new Project
Rachid BENHOCINE / Consultant business intelligence
rbhocine@gmail.com
1
Tutorial Talend
Name project as presentation and check java for Generation language.
Click Finish, and wait for a moment before Talend opens.
Rachid BENHOCINE / Consultant business intelligence
rbhocine@gmail.com
2
Tutorial Talend
For this project, we need to create ODBC source name in order to connect to access database. Create one, and give it name access.
Rachid BENHOCINE / Consultant business intelligence
rbhocine@gmail.com
3
Tutorial Talend
Create a referential to access database as following: from DbConnections, right click and select Create connection.
Set Connection_To_access for the name and click next
Rachid BENHOCINE / Consultant business intelligence
rbhocine@gmail.com
4
Tutorial Talend
Select Generic ODBC for DB Type, and enter access in DataSource.
Rachid BENHOCINE / Consultant business intelligence
rbhocine@gmail.com
5
Tutorial Talend
Rachid BENHOCINE / Consultant business intelligence
rbhocine@gmail.com
6
Tutorial Talend
Select Retrieve Schema from Connectio_To_Access.
Ensure that only TABLE is selected and click next
Rachid BENHOCINE / Consultant business intelligence
rbhocine@gmail.com
7
Tutorial Talend
Select table client and click next
Rachid BENHOCINE / Consultant business intelligence
rbhocine@gmail.com
8
Tutorial Talend
Click Finish
You shall repeat the same thing for oracle connection. Select Create connection from Db Connection.
Rachid BENHOCINE / Consultant business intelligence
rbhocine@gmail.com
9
Tutorial Talend
Enter Connection_To_Oracle for the Name
Rachid BENHOCINE / Consultant business intelligence
rbhocine@gmail.com 10
Tutorial Talend
Select Oracle with SID for DB Type. Enter user name and password, server name, port and SID.
Rachid BENHOCINE / Consultant business intelligence
rbhocine@gmail.com 11
Tutorial Talend
Retrieve Schema of database.
Select table and click Next
Rachid BENHOCINE / Consultant business intelligence
rbhocine@gmail.com 12
Tutorial Talend
Select table test and click Next
Rachid BENHOCINE / Consultant business intelligence
rbhocine@gmail.com 13
Tutorial Talend
Click Finish
Now, we shall create a repository to delimited file. Click Create file delimited from file delimited.
Rachid BENHOCINE / Consultant business intelligence
rbhocine@gmail.com 14
Tutorial Talend
Enter TestFile for the Name
Select the file and click Next
Rachid BENHOCINE / Consultant business intelligence
rbhocine@gmail.com 15
Tutorial Talend
Select comma as Field Separator.and click Next
Click Finish
Rachid BENHOCINE / Consultant business intelligence
rbhocine@gmail.com 16
Tutorial Talend
Now, we shall create a new job. Right click in Job Designs and Create job
Enter firstjob for the name and click Finish
The window of job design opens, drag and drop tDBInput to the workspace.
Choose Repository for Property Type, and select Connection_To_Access in Ripository. Enter client in Table name and click Guess query.
Rachid BENHOCINE / Consultant business intelligence
rbhocine@gmail.com 17
Tutorial Talend
Drag and drop tOracleOutput component into workspace.
Enter information corresponding to this component like this
Rachid BENHOCINE / Consultant business intelligence
rbhocine@gmail.com 18
Tutorial Talend
From Processing, drag and drop tMap component into the workspace.
Right click on tDBInput and select Row>Main, than click tMap. The connection is made between these two components.
Rachid BENHOCINE / Consultant business intelligence
rbhocine@gmail.com 19
Tutorial Talend
Right click on tMap, select Row>New Output. The new dialog opens, name this link test. And click the component tOracleOutput.
Now, you are connected all components, double click on tMap. The window below appears.
Rachid BENHOCINE / Consultant business intelligence
rbhocine@gmail.com 20
Tutorial Talend
Mappe the field code from row1 to CODE in test by drag and drop from row1.code to CODE in test. Repeat the same thing for others fields. Now, you are ready to execute you first job. Cheek Statistics and Traces than Click Run.
Rachid BENHOCINE / Consultant business intelligence
rbhocine@gmail.com 21
Tutorial Talend
As it’s shown, the execution is successfully finished.
Rachid BENHOCINE / Consultant business intelligence
rbhocine@gmail.com 22
Tutorial Talend
Now, we shall use the delimited file to load data into database table. Replace the tDBaseInput component by tFileInputdelimited from File>Input.
Configure the tFileInputDelimited component as following. Choose Repository for Property Type and TestFile for Repository. Select the file in File Name. Cheek that coma “,” is the Field Separator
Rachid BENHOCINE / Consultant business intelligence
rbhocine@gmail.com 23
Tutorial Talend
Make the connection between the tFileInputDelimited and Query components. Double click on query.
Mappe all fields like this
Click Run to execute project.
Rachid BENHOCINE / Consultant business intelligence
rbhocine@gmail.com 24
Tutorial Talend
Fin
Rachid BENHOCINE / Consultant business intelligence
rbhocine@gmail.com 25