on 02-16-2007 1:28 AM
Hi
During my message mapping, I have to convert one String Field from Source Structure to Double ( primitive data type ) field in Target Structure.
String Weight -
Source
Double Wght -
Target
Java Code ****
<b>double Wght = Double.valueOf(Weight.trim()).doubleValue();</b>
But if I use this in UDF then it has default return type as String.
Can I change the return type in UDFs or is their any other way using which I can do this conversion.
Best Regards
- lalit chaudhary -
Inside XML there are only strings.
When in the target structure it is mentioned to have a double, that menas that inside the XML there has to be a string representation of a double value.
This can be any number.
When the sourc provides a number, you need not care about this at all.
Regards
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Lalit,
I think XI takes care of type conversions internally. So you can just do a one-to-one mapping and try executing the scenario.
Regards,
P.Venkat
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In XI mapping, source and target field is always String, by default, left justify.
and the user defined function can only return string type, but if you want a special numberic format, there is a fuction to format number, you can use.
--wenning
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Lalit,
You need not write any code for the conversion. If you have double in target data type, Xi will map the source value (what ever it is) to the double value. But you have to ensure you are passing a double value. Suppose if the source is 10.00 then it is not a problem. But if you are passing 10, XI will pass only 10 to the target. You should handle this.
Regards,
Jai Shankar
User | Count |
---|---|
93 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.