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: 
Romanesku
Contributor III
Contributor III

Update with null key value

Hi all,

I have update action used with four key columns. Sometimes two of them have null value and in this case the update is not performed. How can I solved it?

The values are correct on source and target side, and I do not want to replace the null it if it is not necessary.

 

Thank you.

r. 

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable

If you're using t*Row components, there will already be a "Rejects" output, however if you're using t*Output components, you'll need to un-tick "Use Batch Size" in Advanced Settings in order to enable the "Rejects" output.

View solution in original post

5 Replies
Anonymous
Not applicable

Hi there,

 

If it's the database server which is rejecting your inserts due to nulls in these key fields, then there's really not much you can do about it from the Talend side of things, unless you're prepared to replace the nulls.

 

Regards,

 

 

Chris

Romanesku
Contributor III
Contributor III
Author

But there were no errors. Where can I find the logs or response from rejecting of statement with null value.

 

regards,

 

r.

Anonymous
Not applicable

If you're using t*Row components, there will already be a "Rejects" output, however if you're using t*Output components, you'll need to un-tick "Use Batch Size" in Advanced Settings in order to enable the "Rejects" output.

Romanesku
Contributor III
Contributor III
Author

the target DB is PostgreSQL I am using tPostgresqlOutput, action on data Update. Columns with key have data type (varchar and date) when keys are with values everything is ok, when there is null value in some columns, nothings is updated.

r. 

Anonymous
Not applicable

Edited my original reply, when I should have posted a new one.

 

If you're using t*Row components, there will already be a "Rejects" output, however if you're using t*Output components, you'll need to un-tick "Use Batch Size" in Advanced Settings in order to enable the "Rejects" output.

 

In batch mode, Talend sends batches of say 1,000 inserts to the server at a time, and this means that any errors returned aren't usually specific enough to be useful, or to identify the row in which the error occurred, so the "Rejects" output is disabled.

 

With batch mode turned off, each insert is sent individually, and you'll get meaningful errors back from the server, so "Rejects" is enabled.

 

Batch mode is of course quicker, but not an option if you need to know when individual inserts are failing.

 

t*Row components always operate on a per-row basis, and so will have the "Rejects" output available.

 

There is a "Die on error" option for all of these components, but you'll normally want to deal with errors properly, and at a minimum, log them and continue, rather than aborting the job.