CSV to Database

Four Stars

CSV to Database

How to insert table and table data from CSV File to Database,please provide solution step by step


Accepted Solutions
Highlighted
Moderator

Re: CSV to Database

You're going to need 3 major components:

 

1.tFileInputDelimited

2.tMap

3.a Database output component

 

  • Use the tFileInputDelimited component to insert your CSV file.
  • Connect the tFileInputDelimited to the tMap component and map the columns you want to insert into your database.
  • Connect the tMap component to the Database output component using the output you created in tMap and ensuring all the database information is correct within the Database output component. 

Should look something like this when done.

csv to database example.JPG

View solution in original post


All Replies
Forteen Stars

Re: CSV to Database

  1. Start Talend Studio
  2. Click Import Demo Project
  3. Select Integration

Go thru huge number of examples

 

check site - https://www.talendbyexample.com

Screen Shot 2018-02-05 at 1.06.06 AM.pngScreen Shot 2018-02-05 at 1.05.36 AM.png

-----------
Highlighted
Moderator

Re: CSV to Database

You're going to need 3 major components:

 

1.tFileInputDelimited

2.tMap

3.a Database output component

 

  • Use the tFileInputDelimited component to insert your CSV file.
  • Connect the tFileInputDelimited to the tMap component and map the columns you want to insert into your database.
  • Connect the tMap component to the Database output component using the output you created in tMap and ensuring all the database information is correct within the Database output component. 

Should look something like this when done.

csv to database example.JPG

View solution in original post

Five Stars

Re: CSV to Database

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.

Employee

Re: CSV to Database

Hi Roshan,

 

      Could you please try below method.

 

Step 1:- Take the maximum value of the DB and store it in a context variable

Step 2:- Use a numeric sequence and instead of starting from 1, use the context variable+1 as the starting value.

 

Then the number will increment from that specific value. Please refer the screen shot for details.

 

image.pngimage.pngimage.png

 

Numeric.sequence("s1",(context.max_number+1),1) 

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 :-)

Five Stars

Re: CSV to Database

Thank You very much.... it worked for me.
Nine Stars

Re: CSV to Database

Usually Tschemacomplance check is better to use from CSV to database, because while testing goes, Testers will always put more than the maximum value and test, than entire job fails, Please look at below example for this. It is better to design in this way

CSVToDB.PNG

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

Put Massive Amounts of Data to Work

Learn how to make your data more available, reduce costs and cut your build time

Watch Now

How OTTO Utilizes Big Data to Deliver Personalized Experiences

Read about OTTO's experiences with Big Data and Personalized Experiences

Blog

Talend Integration with Databricks

Take a look at this video about Talend Integration with Databricks

Watch Now