BigDecimal to integer conversion

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!
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.

Calling Talend Open Studio Users

The first 100 community members completing the Open Studio survey win a $10 gift voucher.

Start the survey

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.

Download