hi All,
I have a cloumn called state whose datatype[varchar] length[2]
i have following job:
Oracle enterprise>>>> transformer>>>sequential stage
in transformer i am padding the columns with spaces to create a fixed length record
something like
if IsNull(lnk_db_xfm.State) then PadString(""," ",2) else PadString(lnk_db_xfm.State," ",2-Len(lnk_db_xfm.State))
Other columns works fine but for above column i am getting warnings
Span for padding a substring must be non-negative: 0. No pad
I tried following:
1) checked the length of the state using length function it's 2
2) used if IsNull(lnk_db_xfm.State) then PadString(""," ",2) else PadString(lnk_db_xfm.State," ",0) to check whether v get warnings with ocurence length '0'-- result is no warnings.
3) i tried if IsNull(lnk_db_xfm.State) then PadString(""," ",2) else PadString(lnk_db_xfm.State," ",2-Len(trim(lnk_db_xfm.State))) i tried trim function before getting the length -- result no warnings
The output column is for state is also varchar[2]
Can anyone explain whats happening here!!
Span for padding a substring must be non-negative: 0. No pad
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 42
- Joined: Thu Dec 11, 2008 11:07 am
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
-
- Participant
- Posts: 42
- Joined: Thu Dec 11, 2008 11:07 am
Why don't you just make your target column a char 2 and ensure your APT_STRING_PADCHAR is 0x20, that way you don't need to think about padding... although you may still have to worry about lengths > 2
A peek won't necessarily help if you have more rows than what you are peeking in to. In Oracle do a max(length(state))
A peek won't necessarily help if you have more rows than what you are peeking in to. In Oracle do a max(length(state))
-
- Participant
- Posts: 42
- Joined: Thu Dec 11, 2008 11:07 am