Identify rows resulting in Reference lookup generated X rows

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
wbeitler
Premium Member
Premium Member
Posts: 70
Joined: Tue Feb 21, 2006 2:58 am
Location: Netherlands
Contact:

Identify rows resulting in Reference lookup generated X rows

Post by wbeitler »

All,

is there a simple generic way to capture the rows causing the 'Reference lookup generated X rows'-warning. Logging the current keys used for the lookup would do...

thanks,

William
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Welcome aboard.

Query the reference table.

Code: Select all

SELECT key,COUNT(*) FROM tablename GROUP BY key HAVING COUNT(*) > 1;
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
wbeitler
Premium Member
Premium Member
Posts: 70
Joined: Tue Feb 21, 2006 2:58 am
Location: Netherlands
Contact:

Post by wbeitler »

Ray,

thanks for the reply. As a matter of fact that's exactly the way we currently figure it out at a runtime 'incident'. But what we are actually trying to achieve is that the (keys of) the row(s) causing the warning, also come forward in the Director warning log automatically, so no manual SQL is needed to figure it out at a runtime incident... So next to the warning entry saying: Reference lookup generated X rows'' we would like to have an entry in the log that identifies the row... So querying the reference table is actually the thing we're trying to get rid of.... :?

Thanks,

William
wbeitler
Premium Member
Premium Member
Posts: 70
Joined: Tue Feb 21, 2006 2:58 am
Location: Netherlands
Contact:

Post by wbeitler »

We worked around the problem bij doing the count on the lookup table first (with the same key values). If count > 1 we log the key. Not the cleanest solution imho, but it does the job... So any real solutions are still welcome....
Post Reply