One Star tpk
One Star

tOracleSCD Null Pointer exception

Hi All,
I have a job which will perform SCD type 2 for this i am using tOracleSCD. The first time when i run the job it had run successfully, when i do run for the second time it is throwing a null pointer exception for big decimal. i don't understand why this error is happening. Why the null pointer exception is happening.
The column which are having Big decimal data type are defined as not null columns. So if my select query which i use in my tOracleInput retrieves null value and when we try to update the retrieved values with null values will this error appears? If this is the case how to handle this situation?
I have attached the imageof my job and the error which i am getting when i run the job.
I know there is a bug in TOS 5.0.1 version for tOracleSCD component but if we click continue when the alert appears the job executes, but why is the null Pointer exception coming?
Kindly help me out.
Thanks and Regards,
Pavan
8 REPLIES
One Star tpk
One Star

Re: tOracleSCD Null Pointer exception

Hi All,
Any Ideas why this is happening?
Thanks and Regards,
Pavan
One Star

Re: tOracleSCD Null Pointer exception

try adding a expression filter to bigdecimal column
row1.bigdecimalcolumn==null?0:row1.bigdecimalcolumn
One Star tpk
One Star

Re: tOracleSCD Null Pointer exception

Hi,
Thank you for your suggestion. Where should i add the expression filter in the schema of tOracleSCD right hand side under DB Column in the attached image?
Thanks and Regards,
Pavan
One Star

Re: tOracleSCD Null Pointer exception

use TMAP between input and OracleSCD
One Star tpk
One Star

Re: tOracleSCD Null Pointer exception

Hi
Actually i have done that by adding the tMap component and added the conditional expression for Big Decimal columns but even the same error appears. I am not able to figure it out why the error is being displayed each time when the update is being done.
Is this a issue that Talend is having? How to fix the issue? Is there any another work around how this SCD type 2 can be achieved in Talend
Kindly help me out with your ideas.

Thanks and Regards,
Pavan
One Star tpk
One Star

Re: tOracleSCD Null Pointer exception

Hi Pedro,
As discussed please find the images of my job which i am currently using.
Kindly let me know if you need more information.
Thanks and Regards,
Pavan
One Star

Re: tOracleSCD Null Pointer exception

Hi Pavan
I'm sorry. Because your company forbids exporting job and sending out, I'm trying to reproduce this issue by myself for hours but failed.
I thought this is due to the query of tOracleInput. But after I created a job with wrong query, I didn't get NPE exception, either. I don't know what causes a yellow warning on the top right corner of tOracleInput.
Now please click on 'code' tab and search java.math.BigDecimal.compareTo() method.
Paste the code as much as you can....
Regards,
Pedro
One Star tpk
One Star

Re: tOracleSCD Null Pointer exception

Hi Pedro,
I had sent you an e-mail with the code. Hope this helps.
Thanks and Regards,
Pavan