Page 1 of 1

Most effective way to define a constraint

Posted: Wed Jan 09, 2008 2:43 pm
by eldonp
What is the best way to define a constraint in my situation where I am performing a lookup and want the key column of my source link to match the key column of the lookup link, but i only want data where my non-key column does not match. In psuedocode, this constraint looks like this....


(source.key = lookup.key) and (source.non-key <> lookup.non-key)

Posted: Wed Jan 09, 2008 4:52 pm
by samsuf2002
You should have post this in server forum to get better response, are you getting any issues with the constraint you provide ?

Posted: Wed Jan 09, 2008 5:21 pm
by ray.wurlod
When the lookup fails, the reference input columns are all set to NULL by the Transformer stage, which invalidates the use of "=" and "<>" operators.

You can test the link variable NOTFOUND for the reference input link, which is reliable if the link is fed by Hashed File stage but not, apparently, for other stage types, or you can use IsNull() explicitly to test the key column from the reference input link.

Posted: Wed Jan 09, 2008 9:39 pm
by Havoc
ray.wurlod wrote:When the lookup fails, the reference input columns are all set to NULL by the Transformer stage, which invalidates the use of "=" and "<>" operators.

You can test the link variable NOTFOUND f ...
But if the nullity of the columns from the reference link is set to 'Not Null' , then those columns would be assigned a value. Varchar - a zero length string , Integer - 0 ..

Posted: Wed Jan 09, 2008 10:20 pm
by chulett
Not in a Server job.

Posted: Wed Jan 09, 2008 11:22 pm
by ray.wurlod
Not in a Server job.
Terry Pratchett, Pyramids wrote:The trouble with Ibid is that he thinks he's a bloody authority on everything.