Page 1 of 1

Identify rows resulting in Reference lookup generated X rows

Posted: Fri Nov 21, 2008 4:45 am
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

Posted: Fri Nov 21, 2008 9:56 am
by ray.wurlod
Welcome aboard.

Query the reference table.

Code: Select all

SELECT key,COUNT(*) FROM tablename GROUP BY key HAVING COUNT(*) > 1;

Posted: Fri Nov 21, 2008 1:53 pm
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

Posted: Fri Nov 28, 2008 2:46 am
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....