Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

insert row into table

Hey guys, i'm a beginner Talend user, so, if you know guys how to insert a row into a data base please get me notified

In fact, i want to insert a new row to a data base table of Microsoft SQL server every timem i excute , a new line will be create in the table, which component should i use?

Labels (2)
7 Replies
fdenis
Creator III
Creator III

have a look at trowgenerator (replave 100 by 1 line) to generate row
and use tMSSqlOutput to insert.
ones you have insert your componet on your job you can select it and press f1 for help.
good luck
Anonymous
Not applicable
Author

thank's for helping fdenis, but the problem here that i need some variables from a tmap that i've created, 

and i can't link tmap with a trowgenerator, 

i will be thankful for any other ideas.

Anonymous
Not applicable
Author

Can you please share the details from which source you are inserting a row, is it from database or file. Give a screen shot of job so it would be helpful to see the flow

Anonymous
Not applicable
Author

Use insert into . good luck my friend
Anonymous
Not applicable
Author

Hi @9allel22 ,

 

    Could you please advise what is the business use case you are trying to do by this method? Are your trying to create a DB trigger indirectly?

 

   Sometimes, we may be able to do the overall use case in totally different method. So giving a clear picture about it will help other community members to suggest right solutions.

 

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

@nthampi  @ksingh  @fdenis 

thank you for your feedback guys, here is the request i want to execute
"INSERT INTO [dbo].[CHOIXEXT]
([YX_TYPE]
,[YX_CODE]
,[YX_LIBELLE]
,[YX_ABREGE]
,[YX_LIBRE])
VALUES
(<LA2, nchar(3),>
,< LCW_CodeCHOIXEXT_LA2, nvarchar(17),>
,< MershSubGroupName, nvarchar(105),>
,< MershSubGroup, nvarchar(17),>
,< nv, nvarchar(35),>)
GO"

*"LA2" static String
*"LCW_CodeCHOIXEXT_LA2" request1 result (mentionned in the screenshot below)
*MershSubGroupName form "INV_Product" database
*MershSubGroup form "INV_Product" database
*"nv" static String

thank you for advance guys0683p000009M2vN.png

Anonymous
Not applicable
Author

@9allel22 

 

First, let me reiterate my current understanding of the issue. Please correct if I am wrong anywhere.

 

You are first reading the data from a Product table (far left in your diagram) and if the data is having more than one record, each record will be processed in an iterative manner. You are also checking lot of lookup tables in this process. I am guessing you want to make sure that a match should be there between main and lookup tables. One thing I did not understand is that you are writing to a file in this diagram but in your problem statement, you are asking how to insert. I am confused in this area. Could you please clarify your use case better way here?

 

On a side note, I would suggest you to verify the 4 part best practices Talend DI Blogs also while doing the job design. It will be slightly overwhelming for the next developer if we are trying to do everything in a single tMap. I would advise join 2 to 3 lookup in one tMap and connect the rest in second, third and fourth tMap. That way you will have better control over your data.

 

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 🙂