Lookup Condition

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
vamsi.4a6
Participant
Posts: 334
Joined: Sun Jan 22, 2012 7:06 am
Contact:

Lookup Condition

Post by vamsi.4a6 »

I have two tables table1 and table2.Lookup stage is used between table1 and table2.table1 is master link.In lookup stage we have following properties

Condition is table2.Col2='ABC',condition not met=Continue and Lookup failure=Drop.


I want to convert above logic to sql.Any body help on this.I know how to implement Lookup failure=Drop(Inner join) but not sure how to implement Condition is table2.Col2='ABC',condition not met=Continue in sql query
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post by priyadarshikunal »

Although its a straight forward answer, But I would like to know if you have given any thoughts on this, or if it is a Interview Question.

Why not look at the records in the output for those records which doesn't meet the condition criteria.
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
vamsi.4a6
Participant
Posts: 334
Joined: Sun Jan 22, 2012 7:06 am
Contact:

Post by vamsi.4a6 »

It was not a Interview question.
Thanks and Regards
Vamsi krishna.v
http://datastage-vamsi.blogspot.in/
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Consider the behaviour of the Lookup stage when the Lookup Failed rule is Continue.

With Lookup Failed set to Drop and Condition Not Met set to Continue, the same behaviour will obtain for records in which the condition is not met. However, the condition can not use data from the reference input link, for obvious reasons.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
syedmuhammedmehdi
Participant
Posts: 43
Joined: Wed Feb 12, 2014 12:34 pm
Location: Hyderabad, India

Re: Lookup Condition

Post by syedmuhammedmehdi »

I think this is the answer

select *from table1 t1
inner join table t2
on t1.col1=t2.col1

where col1 - lookup column & as condition t2.col2='ABC' is not dropping any record it is not required in query.
SyedMuhammadMehdi
AshishDevassy
Participant
Posts: 32
Joined: Fri Nov 07, 2014 11:18 am

Post by AshishDevassy »

select
table1.cols,
table2.cols
where
table1.key = table2.key
and
table2.col2 not in ('ABC')
that's wierd ?
Post Reply