One Star

[resolved] Convert with tConvertType null to new BigDecimal(0)

Hello,
I have an input Db which contains columns only with Varchar and I want to convert this to the right type. Then I want save them in my DB.
But if I use the tConvertType component it cant convert a null Value to a BigDecimal value.
How I can convert null values to new BigDecimal(0)?
thx
1 ACCEPTED SOLUTION

Accepted Solutions
Community Manager

Re: [resolved] Convert with tConvertType null to new BigDecimal(0)

Hi 
Try to convert the data type on tMap with this expression:
row3.newColumn==null?new java.math.BigDecimal(0):new java.math.BigDecimal(row3.newColumn)
Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
1 REPLY
Community Manager

Re: [resolved] Convert with tConvertType null to new BigDecimal(0)

Hi 
Try to convert the data type on tMap with this expression:
row3.newColumn==null?new java.math.BigDecimal(0):new java.math.BigDecimal(row3.newColumn)
Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business