insert BigDecimal into table

One Star

insert BigDecimal into table

I am trying to insert BigDecimal into table. But the value which get inserted in table has precision value 4.
The value which should get inserted is like 49.5365 but the value get inserted is 49.5400. Can you please help me out.
The table has a column with datatype as Number(16,4).
I dont want to change table structure.

Moderator

Re: insert BigDecimal into table

Hi,

Could you please show us your screenshot of schema setting in DB component? What's DB type you are using? Does this issue repro on other studio?
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.
Seventeen Stars

Re: insert BigDecimal into table

hi all,

some precision about BigDecimal. It's a java Object.
It's the only type in java to manipulate decimal with no loosing 'precision'.
So it's not a problem from your type in table (except if you try to insert decimal into integer Smiley Wink

Have a llok about this java Object at
http://docs.oracle.com/javase/7/docs/api/java/math/BigDecimal.html
espacially about roundingmode : http://docs.oracle.com/javase/7/docs/api/java/math/RoundingMode.html


an example on stackoverflow  :  http://stackoverflow.com/questions/3843440/bigdecimal-setscale-and-round

regards
laurent

2019 GARTNER 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

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog