on 07-26-2009 4:33 AM
Hi,
http://farm3.static.flickr.com/2446/3757050996_d92374d81c_o.png
In the above mapping screen shot, field2 can have values like...
<root>
<field>AVG</field>
</root>
<root>
<field>AV</field>
</root>
<root>
<field>KCM_IOQ</field>
</root>
<root>
<field>KCM</field>
</root>
<root>
<field>AVGK</field>
</root>
I have to check for field2 == "KCM_" and only one occurrence value for field2 KCM_ comes like this. otherwise field2 will have max of 4 char string. so if I specify substring of 0,4 it is generating OutOfBounds exception for values less than 4.
Here I need to pick up the field KCM_IOQ only out of the mapping.
Thanks,
Venkat.
Edited by: Venkat A on Jul 25, 2009 11:34 PM
I have to check for field2 == "KCM_"
You can do this without using a UDF/ substring function
Use the standard startsWith (Text Function).....check for "KCM_"....will return true/ false....then map to if function and have your Then/ Else logic accordingly
Regards,
Abhishek.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I would write a UDF to pass the string & obtain the Output as true/false. This would eliminate OutOfBounds Exception (for any digit input)...
boolean b = string.startsWith("KCM");
if(true){//Add the required substring to the output}
-Siva Maranani
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
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.