Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

CSV to Database

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

Labels (3)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

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.

0683p000009Lsvb.jpg

View solution in original post

6 Replies
vapukov
Master II
Master II

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

Go thru huge number of examples

 

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

0683p000009Lsu3.png0683p000009Lsu8.png

Anonymous
Not applicable
Author

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.

0683p000009Lsvb.jpg

Anonymous
Not applicable
Author

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.

Anonymous
Not applicable
Author

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.

 

0683p000009M30q.png0683p000009M30r.png0683p000009M2uK.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 🙂

Anonymous
Not applicable
Author

Thank You very much.... it worked for me.
Anonymous
Not applicable
Author

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

0683p000009M2kV.png