Post a reply

Write your message and submit

Options

Click in the dark area of the image to send your post.

Go back

Topic review (newest first)

pedro
2012-02-10 04:38:52

Hi Quentin

The expression is so complex.
Why don't you use the first expression and add tReplace component between tMap and tOracleOutput?

Regards,
Pedro

qleprince
2012-02-09 14:07:01

Hello,

I have a problem in a job, which is supposed to integrate decimal data from a .csv file to oracle database.
There is only one transformation, a division by 100.

The flow is not very complicated :

First step : Input File, the data is cast as a string.

Second step : Tmap, the division is made with the following formula

new BigDecimal(StringHandling.EREPLACE(myflow.myfield, ",", ".")).divide(new BigDecimal(100), 8, java.math.RoundingMode.HALF_UP).toString()

Third step : OracleOutput.

This job works, i just have a problem with the format. For example, if the data value 4,6 in my csv file, it values 0.046 in oracle while i want to have 0,046

I try to use a "ereplace" again. the formula was
StringHandling.EREPLACE(new BigDecimal(StringHandling.EREPLACE(myflow.myfield, ",", ".")).divide(new BigDecimal(100), 8, java.math.RoundingMode.HALF_UP).toString(),".",","). But when i do that, in oracle the value is ,,,,,,,,,, !


Did i do something wrong? I've try other way, by using variables or another Tmap to change the format, but the problem is still present.

Regards,
Quentin.

Board footer

Powered by FluxBB