Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

tMSSqlOutput update or insert on data not working

Hello I'm reading a delimeted input file and putting that info on SQL Server. Depending on "shop_number" field (that is not PK) from the file, I have to update an existing row or insert a new one into the DB. On my tMSSqlOutput ("Pedido") I selected "update or insert" option on data, and removed the PK field from the schema, I also marked the "shop_number" as key. But when I execute the project, it gets stucked in the red circled part.
I used "sp_who" in the database, and it seems that talend is locking the table and it cant goes on.
whay should I do to get my data into the table? (if im not being clear enough, let me know, so I try to explain it another way)
Labels (2)
20 Replies
Anonymous
Not applicable
Author

Hi
Why do you remove the PK field from the schema?
Please show me the schema of your input file and the schema of your db table.
Best regards!
Pedro
Anonymous
Not applicable
Author

Hi
Why do you remove the PK field from the schema?
Please show me the schema of your input file and the schema of your db table.
Best regards!
Pedro

Hello, this is the tMap1 from the other image. The problem is with the "saidaPedido" output, my table layout is exactily that, excepts for the PK I deleted from the mapping. I want to use the field "num_pedido" as key to see if this row should be inserted or updated.

EDIT: I renamed the outputs from the 1st image. 'saida1' is now 'saidaCliente', and 'saida2' is now 'saidaPedido'.
Anonymous
Not applicable
Author

Hi
I guess this is an issue at database side.
Restart your MSSQL server and run job again.
Can this issue be reproduced?
Best regards!
Pedro
Anonymous
Not applicable
Author

just restarted the computer, but the problem still persists... 😕
I dont know how you can reproduce this...
ytuzet
Creator
Creator

Hi,
what information do you catch from sp_who?
is the job running well without call to sp_who?
Anonymous
Not applicable
Author

Hi,
what information do you catch from sp_who?
is the job running well without call to sp_who?

The sp_who command doesnt affect the job's performance.
and here are the 2 screenshots from my sp_who before and during job execution.
ytuzet
Creator
Creator

ok I was thinking you use sp_who in your job
maybe you can try to put a mssqlconnection and mssqlcommit after each subjob that writes to db
(even if MSSQL is rarely configured for commits and rollbacks)
Anonymous
Not applicable
Author

just tried the commit, it didnt work, although it gave a clue about the problem... seems like 'Pedido' output is having some trouble to execute.
ytuzet
Creator
Creator

any particularies on that table, contraints etc ?