cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping Logic needed

Former Member
0 Kudos

Dear Frnds,

I have a field name Area, its maximum size is 4 ..

if it contains 2 numbers i can stuff other 2 numbers as Zeros using FORMAT NUM fn.

But if the field is alpha numerical it has to passed as it is.. and if it is numbers the above logic has to be applied..

how to acheive both of them

any stndrd fn or UDF is needed?

Edited by: prabhas465 on Feb 9, 2011 11:46 AM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

You need to write a UDF to achieve the requirement. There is no standard function to validate this condition and pass the value.

Thanks,

Former Member
0 Kudos

Thanks Hareen..

i am weak at writing UDF's . Any help would be appreciated

Former Member
0 Kudos

Hi,

Chk this: Context will be a single value

if (a.matches("[a-zA-z]*"))

{

return a;

}

else

{

if(a.length()<4)

{

for(int i=0;i<=(4-a.length()) ;i++)

{

a = a + "0";

}

}

return a;

}

Thanks

Amit

Answers (0)