One Star

int to bigdecimal

hello,
i have a process where i need to map int to bigdecimal column.
i have this function Numeric.sequence("TRAB_SEQUENCE",context.last_id,1) in expression builder and type bigdecimal
but i have this error
"type mismatch: cannot convert from integer to bigdecimal"
when changed the type to "int" i had the same error because the output column is Bigdecimal.
how can i fixed that?
thanks in advance
RT
3 REPLIES

Re: int to bigdecimal

You have to create a BigDecimal value from the value returned by Numeric.sequence, which is an int.
I think this will work:
new BigDecimal(Numeric.sequence("TRAB_SEQUENCE",context.last_id,1))
new creates a variable of type BigDecimal, and it is set to the value returned from your call to sequence.
One Star

Re: int to bigdecimal

You have to create a BigDecimal value from the value returned by Numeric.sequence, which is an int.
I think this will work:
new BigDecimal(Numeric.sequence("TRAB_SEQUENCE",context.last_id,1))
new creates a variable of type BigDecimal, and it is set to the value returned from your call to sequence.

you are the Best. thanks a lot
RT
One Star

Re: int to bigdecimal

Could you paste the complete code of the tJavaRow?
Thanks!