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


All Replies
Thirteen 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

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

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


Warm Regards,
Nikhil Thampi
Please appreciate our members by giving Kudos for spending their time for your query. If your query is answered, please mark the topic as resolved :-)
Highlighted
Five Stars

Re: CSV to Database

Thank You very much.... it worked for me.
Six 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

Warm Regards,
Please don't forget to give Kudos if it resolves issue, and if you think its Apt you can also mark its as solution.

Cloud Free Trial

Try Talend Cloud free for 30 days.

Tutorial

Introduction to Talend Open Studio for Data Integration.

Definitive Guide to Data Integration

Practical steps to developing your data integration strategy.

Definitive Guide to Data Quality

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