Right Padding Spaces
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 38
- Joined: Wed Sep 19, 2007 10:11 am
- Location: Canada
write your output to a file rather than oracle. look at the file, if you have "hello" in the file it means you are screwing something before loading, if you see "hello " then there is problem in loading.
make sure the string size is correct. if the target field in the transformer stage is char(5) and you padstring(in.XXX,' ',6) you will get a "hello" no matter what. make sure the target field is the right size, then make sure all the way upto table the size is correct. this is a common problem we get and just by looking at field size it can be solved.
someone said a char(10) will always be 10 characters, true and false. true about the amount of characters, false about spaces, char(10) = 'hello' will not make it 'hello '. in fact it will make it 'hellonullnullnullnullnull'
make sure the string size is correct. if the target field in the transformer stage is char(5) and you padstring(in.XXX,' ',6) you will get a "hello" no matter what. make sure the target field is the right size, then make sure all the way upto table the size is correct. this is a common problem we get and just by looking at field size it can be solved.
someone said a char(10) will always be 10 characters, true and false. true about the amount of characters, false about spaces, char(10) = 'hello' will not make it 'hello '. in fact it will make it 'hellonullnullnullnullnull'
-
- Participant
- Posts: 38
- Joined: Wed Sep 19, 2007 10:11 am
- Location: Canada
write your output to a file rather than oracle. look at the file, if you have "hello" in the file it means you are screwing something before loading, if you see "hello " then there is problem in loading.
make sure the string size is correct. if the target field in the transformer stage is char(5) and you padstring(in.XXX,' ',6) you will get a "hello" no matter what. make sure the target field is the right size, then make sure all the way upto table the size is correct. this is a common problem we get and just by looking at field size it can be solved.
someone said a char(10) will always be 10 characters, true and false. true about the amount of characters, false about spaces, char(10) = 'hello' will not make it 'hello '. in fact it will make it 'hellonullnullnullnullnull'
make sure the string size is correct. if the target field in the transformer stage is char(5) and you padstring(in.XXX,' ',6) you will get a "hello" no matter what. make sure the target field is the right size, then make sure all the way upto table the size is correct. this is a common problem we get and just by looking at field size it can be solved.
someone said a char(10) will always be 10 characters, true and false. true about the amount of characters, false about spaces, char(10) = 'hello' will not make it 'hello '. in fact it will make it 'hellonullnullnullnullnull'
Hello All,
Finally, somehow got this working.
Firstly did a trim on my Source while reading from Oracle stage (User Defined SQL). Read it as Char in Column Definitions. Concatnated 10 spaces to it before putting it in Target field in Transformer(Link.XXX : ' ').
Extra spaces got trimmed off automatically while loading.
Environment Variable used is Oracle_Load_Delimited = ,
Still wonder why PadString didn't worked.
Any way I'll mark this resolved.
Thanks to All.
Finally, somehow got this working.
Firstly did a trim on my Source while reading from Oracle stage (User Defined SQL). Read it as Char in Column Definitions. Concatnated 10 spaces to it before putting it in Target field in Transformer(Link.XXX : ' ').
Extra spaces got trimmed off automatically while loading.
Environment Variable used is Oracle_Load_Delimited = ,
Still wonder why PadString didn't worked.
Any way I'll mark this resolved.
Thanks to All.
Hello All,
Finally, somehow got this working.
Firstly did a trim on my Source while reading from Oracle stage (User Defined SQL). Read it as Char in Column Definitions. Concatnated 10 spaces to it before putting it in Target field in Transformer(Link.XXX : ' ').
Extra spaces got trimmed off automatically while loading.
Environment Variable used is Oracle_Load_Delimited = ,
Still wonder why PadString didn't worked.
Any way I'll mark this resolved.
Thanks to All.
Finally, somehow got this working.
Firstly did a trim on my Source while reading from Oracle stage (User Defined SQL). Read it as Char in Column Definitions. Concatnated 10 spaces to it before putting it in Target field in Transformer(Link.XXX : ' ').
Extra spaces got trimmed off automatically while loading.
Environment Variable used is Oracle_Load_Delimited = ,
Still wonder why PadString didn't worked.
Any way I'll mark this resolved.
Thanks to All.