on 05-30-2008 12:50 PM
Hi Guru
please i have a question about mapping. I need to map two sys like that:
the souce sys have length = 40 but the Target sys is DB and need only 26 string or Char.
source sys -
> name(40)
Target sys -
name (26)
please could tell me how i can resolve this step? I have trying with Graphical mapping like name----length = constant 40 -
if then -
name ---substring(0....26) but i have error
please could you give input!
Thanks in advance.
Hi,
Try this UDF.
Hi,
public String mapxxx(String a,Container container)
{
if(a.length()>0)
{
String b=a.substring(0,25);
return b;
}
else
return a;
}
Regards,
Soumya.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi I think the problem you are facing is that the source system has a string of max 40, but the input need not always be 40. So what i would recommend you to do is, try and concat 40 spaces to the input.
Try something like this
Src String -->mapwithdefault(space) --> concat --> constant (40spaces) --> substring(0,26) --> target String.
Sameer
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
thank you very much for the answer. Ich done this and i have for example error name can't be convert in boolean ! or i can' t see the field in the Target sys!
Thanks in advance.
Dominique
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Use Standard Function Substing: on that In Starting Position u put : 0
Use Number of Characters u put : 25 and click ok.
Use like this 0 counts the first character + 25 = 26
Thanks,
Satya Kumar
Edited by: SATYA KUMAR AKKARABOYANA on May 30, 2008 2:02 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
use substring(0,27) instead of (0,26)
Thanks
Farooq
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
What exact error it is giving?Please mention in the thread.
substring is the option were u can make the 40lenght char to 26 char.
Thanks
phani
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
In the DB side you have only 26 fields, so it tkes 26 only.
In the mapping you use the substring function, here you double click on that and specify the starting position(0) and number of characters(26), that means it takes 26 characters from index 0 to 25.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.