Mapping one data type to another

One Star

Mapping one data type to another

I've set up data replication from one database to another. From each database I've imported a table schema and find that the data types for each differ where one holds Double values and the other Float.
My issue is that, while configuring a tMap to map fields between the database tables (chng_qty(Double) -to- CHGQT(Float)) the tMap shows an error "Error on row1.chng_qty=> Type mismatch: Cannot convert from Double to Float."
I've tried to make this conversion by using the Expression Builder but can find no way to do this.
Can anyone please help me understand how to convert data types between database schemas?
Thanks.
One Star

Re: Mapping one data type to another

You should be able to use the native java methods for float to convert it to a double.
A float in java has the method doubleValue() which returns a double from a float value. You should be able to do something akin to floatValue.doubleValue() and to get the double you want from the float.
One Star

Re: Mapping one data type to another

Thanks for the suggestiong.
I'm a Java programmer so I understand that I could do the conversion in a method of some sort but I'm unclear how to get that processing into the tMap. I've tried to add my own methods to the DataOperation expression class but it's read-only in the workspace.
I assumed that data type mapping would be such a common practice that there'd be a mechanism for it already without my having to code it into a custom routine.
Is that not the case?