Hi,
I am trying to trim few of the varchar columns.
I am using a generic job which uses a schma file to load from the file to the database.
Is there way i can use a trim function on the varchar columns.
I saw few of the posts which said this is not possible in RCP.
Want to get any idea on how to do it.
REgards,
Samyam
Trim in Schema file
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 258
- Joined: Tue Jul 04, 2006 10:35 pm
- Location: Toronto
-
- Premium Member
- Posts: 258
- Joined: Tue Jul 04, 2006 10:35 pm
- Location: Toronto
The modify stage can do this, in a manner. While it won't select all string columns from a schema, if you have a parameter called "ColumnName" with the name of the string column to trim, then the modify action of
"#ColumnName#=trim(#ColumnName#)" will do what you want for one column.
"#ColumnName#=trim(#ColumnName#)" will do what you want for one column.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Sorry, I mis-pasted the function, it is as Ray notes, "string_trim". I took a quick look at what might be done that could apply across a whole schema but don't think that there is any such functionality.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
You could perform the import (read) using a single VarChar column (which could be trimmed in a Modify stage) and then perform the parsing in a Column Import stage (which can use a schema file). An added benefit is that your parsing can be performed in parallel mode.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Premium Member
- Posts: 258
- Joined: Tue Jul 04, 2006 10:35 pm
- Location: Toronto