Most effective way to define a constraint

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
eldonp
Participant
Posts: 47
Joined: Thu Jun 19, 2003 3:49 am

Most effective way to define a constraint

Post 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)
samsuf2002
Premium Member
Premium Member
Posts: 397
Joined: Wed Apr 12, 2006 2:28 pm
Location: Tennesse

Post by samsuf2002 »

You should have post this in server forum to get better response, are you getting any issues with the constraint you provide ?
hi sam here
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Havoc
Participant
Posts: 110
Joined: Fri Nov 24, 2006 8:26 am

Post 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 ..
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Not in a Server job.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply