Question on PX lookup

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
chanaka
Premium Member
Premium Member
Posts: 96
Joined: Tue Sep 15, 2009 4:06 am
Location: United States

Question on PX lookup

Post by chanaka »

Hi All,

I know this is a simple question. However I hear different answers from different people and I dont know whats the truth.

Consider the following scenario in a PX job.

Job reads field A(char 6) from table X. In a lookup stage input link it is reading fields B & C where C is of VARCHAR 120 and B is the integer key. For the lookup to happen properly do we have to cast the field C to VARCHAR 6 after trimming when we do the read from the lookup table before it reaches the lookup stage?

Thanks!

Chanaka
Chanaka Wagoda
Shruthi
Participant
Posts: 74
Joined: Sun Oct 05, 2008 10:59 pm
Location: Bangalore

Re: Question on PX lookup

Post by Shruthi »

Its not required to trim varchar columns. In case, if column C has CHAR datatype, then trimming is required
nani0907
Participant
Posts: 155
Joined: Wed Apr 18, 2007 10:30 am

Post by nani0907 »

I is googd to do trim on varchar columns too.Recenlty i faced a problem while inserting the data into oracle table which shows error "Statement parsed".Once after doing trim on varchar columns,the insert job finished successfully.
thanks n regards
nani
raghu22
Premium Member
Premium Member
Posts: 15
Joined: Sun Oct 11, 2009 11:33 am

Post by raghu22 »

Whenever using the lookup, its better to use trim function and do lookup on the same datatype.... We faced a problem recently using lookup ... Our source is char(1) and lookup is varchar(1).... when is the number or character, lookup is successful and when there is a space in the source and there is match for space in the lookup also but lookup failed... when we used cast function and changed the datatype char to varchar at the source... then lookup was success...
Post Reply