Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
HI,
I have a job which performs and update or insert on a table but it currently takes too long to run. In the past I've replaced a single dboutput component with 2 and used a map inner join to split out the inserts and updates so I can more efficiently deal with the data.
In this particular job I'm not getting the results I'm expecting. The inner join seems to be rejecting too many rows and I'm getting errors about inserting duplicate keys from the dbOutput that is configured for inserts.
I've confirmed in the database that the majority of the data that is being rejected by the inner join exists in the database.
Can anyone help me in diagnosing what is wrong with the job or what I've missed?
Thanks
Thanks @TRF and @nthampi for your help. Through adding extra debugging I eventually discovered that the consumer_key column in my db was a char field and any values that were shorter than the length of the field had trailing spaces added as padding. I changes the settings on the MSSQLInput to trim String/Char columns and now it works perfectly.
I've attached screen shots of the tmap to the original post
On the main input I have all columns
The lookup input I've limited to the primary key (a single column) and have joined it to the main row
The outputs are based on the same table as the lookup but duplicated - 1st is for updates and the second is for inserts
Hi,
Could you please try the Unique Match option in tmap and let us know the results? I could see that you are using All Matches option in your current join.
Since you are trying to check whether the incoming data is having a matching record in DB, unique match should be enough in your case.
Warm Regards,
Nikhil Thampi
Thanks @TRF and @nthampi for your help. Through adding extra debugging I eventually discovered that the consumer_key column in my db was a char field and any values that were shorter than the length of the field had trailing spaces added as padding. I changes the settings on the MSSQLInput to trim String/Char columns and now it works perfectly.