Page 1 of 1

Lookup value 0

Posted: Wed Feb 08, 2012 3:55 pm
by pratapsriram
What does a resulting value of 0 mean when we do a lookup?

I have an Underwriter_id(char 10) in Source. User_id(carchar 10) in lookup table. The data types are different. But the lookup is failing. But if I do it from the database then the match is there. So if the lookup action is drop then the record is dropped. If it is continue then the peek stage shows the value as 0000000000. So wondering how to do this. I have used UpCase(TrimB(User_Id)) for lookup and respectively for the Underwriter_id too but still getting this error. Is this a problem because of the datatype? Just mind boggling.

Posted: Wed Feb 08, 2012 4:00 pm
by kumar_s
Is there any auto conversion into Integer?
Try to make sime dataytpe at both input and reference. Try converting the Char into Varchar.

Posted: Wed Feb 08, 2012 4:06 pm
by Kryt0n
A char 10 will be of length 10 padded with whatever you padchar is set to (seemingly 0...) so unless your are actually comparing 10 against 10, you're unlikely to get the match, you will need to convert to varchar with trimming pad character or convert the varchar to char 10 (former sounds preferable)

Posted: Wed Feb 08, 2012 4:19 pm
by pratapsriram
So I should include the APT_PADCHAR in the parameters and change the datatype to resolve this issue?

Posted: Wed Feb 08, 2012 4:20 pm
by pratapsriram
So I should include the APT_PADCHAR in the parameters and change the datatype to resolve this issue?

Posted: Wed Feb 08, 2012 5:33 pm
by Kryt0n
What have you set the APT_PADCHAR to?

Easiest start will probably be to send your lookup to a peek, maybe with a transform in the middle to surround the value in braces or convert the field to hex. I can't say what your data looks like so can't recommend a solution but clearly one side is not the same as the other.

Posted: Wed Feb 08, 2012 6:42 pm
by ray.wurlod
Char(10) to Integer may be illegal, if the value is greater than 2^31-1.

Re: Lookup value 0

Posted: Wed Feb 08, 2012 7:17 pm
by SURA
If your source and lookup data is from table, then you can do type cast the data to common data without affecting the value of the data, before it do the lookup.

DS User

Posted: Thu Feb 09, 2012 8:06 am
by pratapsriram
I changed the datatype to varchar(10) on both the source link and the lookup links and added APT_STRINGPADCHAR of 0x0. Still getting the same problem. So now going to change both of the links to Char(10) and try. Hope it works.

Posted: Thu Feb 09, 2012 8:21 am
by pratapsriram
Yes!!!! Changing to to Char(10) on both the links worked. One more thing the data is alphanumerical just an FYI so it can help others later on.