One Star

BigDecimal to integer conversion

Hi,
I'm super new to Talend and am running into a problem while extracting data from an oracle database and loading it into a postgres db. I have a few columns that have use the oracle bigDecimal datatype without a precision. To me that meant that its a just a large integer (double) - the postgres db has the equivalent column using an integer datatype. When I try to directly move data through tMap I get an bigDecimal to integer conversion error.
In Java, I know we would use bigDecimalVar.intValue() to convert the bigDecimal into an integer. How do I implement this in tMap? I tried using the bigDecimalColumn.intValue() in the expression box but I get a Java lang error.
Help!
Thanks!
6 REPLIES
One Star

Re: BigDecimal to integer conversion

This is the expression I'm trying to use:
row1.DS_PRS_ID.intValue()
Seventeen Stars

Re: BigDecimal to integer conversion

If you get an Java compilation error this way than at first I would check if I get REAL a BigDecimal as object type.
Could you provide the error message?
One Star

Re: BigDecimal to integer conversion

hello all,
i want to convert BigDecimal to integer ,
I am using Integer.parseInt(row.columnname)
but its not working........
please provide solution for this.
One Star

Re: BigDecimal to integer conversion

Hi indra,
intValue() convert the big decimal to integer
row3.test.intValue()
Regards,
kumar
One Star

Re: BigDecimal to integer conversion

hello all,
i want to convert BigDecimal to integer ,
I am using Integer.parseInt(row.columnname)
but its not working........
please provide solution for this.
Moderator

Re: BigDecimal to integer conversion

Hi prudvi,
Have you tried to use
row1.newColumn.intValue() //The type of newColumn is BigDecimal.
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.