capture duplicate data

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
rmeenakumari822
Participant
Posts: 30
Joined: Sat Oct 25, 2008 9:09 pm
Location: chennai

capture duplicate data

Post by rmeenakumari822 »

Hi,

1. I have a source like

id name sal
1 aaa 1000
2 bbb 2350
1 aaa 1700
3 ccc 3690
1 aaa 4000
2 bbb 3000

in target duplicate records must be caputure

1 aaa 1000
1 aaa 1700
2 bbb 2350
How to solve it?

2. How to capture only the Duplicate record for source using SQL query?
priya
chandrababu.Datastage
Participant
Posts: 2
Joined: Wed Nov 19, 2008 1:01 am

Re: capture duplicate data

Post by chandrababu.Datastage »

[quote="rmeenakumari822"]Hi,

1. I have a source like

id name sal
1 aaa 1000
2 bbb 2350
1 aaa 1700
3 ccc 3690
1 aaa 4000
2 bbb 3000

in target duplicate records must be caputure

1 aaa 1000
1 aaa 1700
2 bbb 2350
How to solve it?

2. How to capture only the Duplicate record for source using SQL query?[/quoteUse remove duplicates stage and get rejects as your output..
rmeenakumari822
Participant
Posts: 30
Joined: Sat Oct 25, 2008 9:09 pm
Location: chennai

Re: capture duplicate data

Post by rmeenakumari822 »

Hi,

by using remove duplicate stage duplicate data will be removed but i want to caputured the duplicate data to one target table how?
priya
rmeenakumari822
Participant
Posts: 30
Joined: Sat Oct 25, 2008 9:09 pm
Location: chennai

Re: capture duplicate data

Post by rmeenakumari822 »

Hi,

by using remove duplicate stage duplicate data will be removed but i want to caputured the duplicate data to one target table

how to solve it?
priya
DEEPTI
Participant
Posts: 9
Joined: Wed Nov 21, 2007 12:19 am

Re: capture duplicate data

Post by DEEPTI »

Hope this might help you

viewtopic.php?t=115596&highlight=capture+duplicates

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

Post by ray.wurlod »

Search - this question has been answered at least twice in the past.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
fareeda_b
Participant
Posts: 48
Joined: Sat Feb 23, 2008 4:25 pm

Capture duplicate data

Post by fareeda_b »

Hi ,

SELECT COUNT(1), COLUMN_NAME
FROM TABLE_NAME
GROUP BY COLUMN_NAME
HAVING COUNT(1) > 1


hope this might help you.


thanks
fareeda
Thanks
hemanthakumar
Participant
Posts: 34
Joined: Mon May 05, 2008 1:31 am

Post by hemanthakumar »

Hi,
Use the following stages.

Source----Aggregator----Transformer----Tgt1
|
|
Tgt2

In Aggregator group by id,count(id) then for Transaformer stage take targets then in Constraint write count > 1 to Tgt1, otherwise for Tgt2.It will work.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

But it will not preserve the original rows. This design will. Filter on count < 4.

Code: Select all

source --->  Copy  --->  Join  --->  Filter  --->  target
               |           ^
               |           |
               +-->  Aggregator
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