Usage of Iterate link with Db component

Six Stars

Usage of Iterate link with Db component

Hello,

 

I don't know exactly the best way to realize the following.

I need to process a list of file to put the content (each line) in DB.

I use the following structure :

tFileList (list each file) -> Iterate -> tFileInputRegex (extract only some line) -> Main ->tMap (add info) -> Main -> tOracleOutput.

The process is good but I don't know the correct "Action on table" to make.

I would like to drop the table and create only one time by execution not by file (by iteration) but I don't know how to do this.

 

Thanks in advance

 

Dimitri

 

Employee

Re: Usage of Iterate link with Db component

Hi Dimitri,

 

      If you are looking to iterate the result set from a file at the rate of one record per execution, then the best way to do it is by using tFlowtoIterate. Please refer the link below to get details about this component.

 

https://help.talend.com/reader/wDRBNUuxk629sNcI0dNYaA/WqJCkTE5~5DDaSFvtNXZnQ

 

     Now, coming to your query about what you need to select for Action on table, the answer depends on your specific requirement. The details for various values are as shown below. If you are having any further queries, please feel free to reply to the post.

 

Default: No operation is carried out.

Drop and create table: The table is removed and created again.

Create table: The table does not exist and gets created.

Create table if not exists: The table is created if it does not exist.

Drop table if exists and create: The table is removed if it already exists and created again.

Clear table: The table content is deleted.

Truncate table: The table content is deleted. You do not have the possibility to rollback the operation.

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved :-)

Highlighted
Six Stars

Re: Usage of Iterate link with Db component

Hello,

No... I would like to iterate on each file to extract n lines, keep n lines and after process n lines in one flow.

 

Today, I do the following :

a subjob, with :

tFileList (list each file) -> Iterate -> tFileInputRegex (extract only some line) -> Main ->tMap (add info) -> Main -> tDeilimitedFileOutput

And onsubjob ok : tDelimitedFileInput -> tOracleOutput

It's work but I have a temporary file maybe the best design.

Regards

Dimitri

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.

Download