Warning message about duplicate entry

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
somu_june
Premium Member
Premium Member
Posts: 439
Joined: Wed Sep 14, 2005 9:28 am
Location: 36p,reading road

Warning message about duplicate entry

Post by somu_june »

Hi,

When Iam running a job which has lookup stage that is looking to db2 table. Iam getting a warning . Please help me in getting out of this warning.

warning message:

Lookup,0: Ignoring duplicate entry at table record 5,216; no further warnings will be issued for this table


Thanks,
Somaraju
somaraju
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Hi,
This warning cant be cut from DS (Other that message handler :wink: ). DB2 source has duplicates on the key you specified. Try to avoid that, or specify composit key.

-Kumar
somu_june
Premium Member
Premium Member
Posts: 439
Joined: Wed Sep 14, 2005 9:28 am
Location: 36p,reading road

Post by somu_june »

Hi Kumar,

Thanks for your replys. They are really helping me to solve my problems .Can I use select distinct columm1,columm2 from table. so that I can over come this problem.


Thanks,
Somaraju
somaraju
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Yes you can, provided the lookup value is also duplicated. Else you shouldnt loose the valuble value. (By extracting first or last records).
You may also need to concentrate on the loading process of data into DB2. Root cause of the duplicated.

-Kumar
somu_june
Premium Member
Premium Member
Posts: 439
Joined: Wed Sep 14, 2005 9:28 am
Location: 36p,reading road

Post by somu_june »

Hi Kumar,

I selected Enter custom sql in DB2 stage and I provided sql as select Distinct xxx, uuu,yyy,zzzz fom ttttttttt where xxx= '230' . But Iam getting the same warning as I mentioned above. duplicate entry warning. You siad allow duplicate in look up stage .How to do that please guide me. Iam giving key as
xxx and zzzz in lookup



Thanks,
Somaraju
somaraju
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Hi,

You query extracts the distinct value among the combination of xxx, uuu,yyy,zzzz. Where as your key is only xxx and zzz. Where still there is the possibilites of duplicate of the key.
To ensue the non duplicates try with select count(*) from ttttttt group by xxx, zzz and ensure you are getting all 1s.
And more over i dont recall, that i told regarding the option of allow duplictes in Lookup.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
MTA
Participant
Posts: 37
Joined: Thu Feb 02, 2006 2:25 pm

Post by MTA »

Somu, You might as well consider using a sort stage between the db2 lookup stage and look you stage. The advantage of using sort stage is two fold.
1) you can remove duplicates
2) Having sorted data will help improve performence.
M.T.Anwer
The day the child realizes that all adults are imperfect he becomes an adolescent;
the day he forgives them, he becomes an adult; the day he forgives himself, he becomes wise.
-Aiden Nowlan
Post Reply