Hi,
I am trying to do a lookup on Char and varchar columns. My job design is as follows:-
(DB1 --> Funnel <-- DB2) -->Transformer --> (Lookup <-- Seq File) --> DB Target
DB1 has Code (Char 3) and Scheme (Varchar 20) as Key columns
DB2 has Code (Char 3) and Scheme (Varchar 20) as Key colums.
DB2 however has char of length 2 as data.
The funnel has the output Code (Char 3) and Scheme (Varchar 20) as output along with other columns..
In the lookup, the Sequential file has both the Code and Scheme cols as Varchar 20..
The lookup works fine for the records of DB1, however fails for DB2..
The Code and Scheme Columns are however trimmed for DB2 in the source itself.
Please provide some suggestions to overcome the failure
Lookup Failure
Moderators: chulett, rschirm, roy
So DB2 fails because it is comparing "XX " to "XX" is what you are saying? If that's the case, then yes you do need to trim that source field but you need to ensure your target for the trim() function is a varchar. Trimming a char to a char is a waste of time as the datatype just automatically pads it back out.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers