CSV to Database with increment in id column for each record

Highlighted
Five Stars

CSV to Database with increment in id column for each record

Hello, I am kinda new to Talend I understood CSV to DataBase.

But I have one scenario that I could not find any where.

I have to do csv to DataBase but I don't have column id in csv but I have it in my table which is primary key and not auto increment.

And I have to dump CSV data in table in such a way that for every record in CSV I have to put id in table as max(id+1)

please help....... I am trying this since last 2 weeks.


Accepted Solutions
Employee

Re: CSV to Database with increment in id column for each record

Hi Roshan, The answer is available in below link and it seems my answer has helped to resolve your issue. https://community.talend.com/t5/Design-and-Development/CSV-to-Database/m-p/150448#M91975 You can try the method specified by Manohar also and it will also give you the same results. 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 :-)

View solution in original post


All Replies
Highlighted
Moderator

Re: CSV to Database with increment in id column for each record

@roshan_wani , as part of pre job take the Max id form the target table and load as global variable and use that global variable to do incremental in tmap in the main job while loading from CSV to database using Numeric sequence 

Manohar B
Don't forget to give kudos/accept the solution when a replay is helpful.
Employee

Re: CSV to Database with increment in id column for each record

Hi Roshan, The answer is available in below link and it seems my answer has helped to resolve your issue. https://community.talend.com/t5/Design-and-Development/CSV-to-Database/m-p/150448#M91975 You can try the method specified by Manohar also and it will also give you the same results. 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 :-)

View solution in original post

2019 GARTNER 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

Best Practices for Using Context Variables with Talend – Part 2

Part 2 of a series on Context Variables

Blog

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog