Page 1 of 1

Question on PX lookup

Posted: Wed Dec 08, 2010 6:10 pm
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

Re: Question on PX lookup

Posted: Thu Dec 09, 2010 1:14 am
by Shruthi
Its not required to trim varchar columns. In case, if column C has CHAR datatype, then trimming is required

Posted: Thu Dec 09, 2010 2:36 am
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.

Posted: Thu Dec 09, 2010 9:52 am
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...