Six Stars

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. 

2 ACCEPTED SOLUTIONS

Accepted Solutions
Six Stars

Re: Update with null key value

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.

Six Stars

Re: Update with null key value

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. 

5 REPLIES
Six Stars

Re: Update with null key value

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

Six Stars

Re: Update with null key value

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

 

regards,

 

r.

Six Stars

Re: Update with null key value

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.

Six Stars

Re: Update with null key value

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. 

Six Stars

Re: Update with null key value

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.