Data insert multiple times in target database
Moderators: chulett, rschirm, roy
Data insert multiple times in target database
Hi,
I have a question like in my job design .Its a very simple job i am just extract the data from sequential file and load it into target database with same hard code values and the job is run fine but the problem is whenever i run the same job 2 or3 times again the same data insert in 2 and 3 times in target database means duplicates of data inserted again and again For instance if i insert 1,2,3 and rerun the job again it will again insert 1,2,3 mean data is insert multiple times so is there any way by which data should be insert one time only once if i run the same job again and again.
Please somebody help me on this problem.
I have a question like in my job design .Its a very simple job i am just extract the data from sequential file and load it into target database with same hard code values and the job is run fine but the problem is whenever i run the same job 2 or3 times again the same data insert in 2 and 3 times in target database means duplicates of data inserted again and again For instance if i insert 1,2,3 and rerun the job again it will again insert 1,2,3 mean data is insert multiple times so is there any way by which data should be insert one time only once if i run the same job again and again.
Please somebody help me on this problem.
-
- Premium Member
- Posts: 72
- Joined: Mon Jul 06, 2009 9:34 pm
- Location: Sydney
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 26
- Joined: Thu Aug 12, 2010 12:07 am
First you define the keys in the target stage based on your requirement then
if your database is DB2 then use load type as UPSERT(UPDATE+INSERT), it will insert the record if it is new else it will update.
If your databse is Oracle use "insert else update" approach as suggested by chulett.
Please let us know your target databse and the target columns(both keys and non keys)
if your database is DB2 then use load type as UPSERT(UPDATE+INSERT), it will insert the record if it is new else it will update.
If your databse is Oracle use "insert else update" approach as suggested by chulett.
Please let us know your target databse and the target columns(both keys and non keys)
hi,
My target database is DB2 .Here is my job design.
IN TARGET DATABASE I AM DOING ONLY INSERT OPERATION AND AFTER RUNNING JOB AGAIN SAME DATA INSERT AGAIN.
IS IT THIS ONE HAPPENS DUE TO MERGE STAGE OR I HAVE TO USE LOOK UP STAGE .
Reply me please and thanks for quick reponses
My target database is DB2 .Here is my job design.
Code: Select all
Seqfile........>
MERGESTAGE......>XFM...........> DB2 DATABASE
ODBC .........>
IS IT THIS ONE HAPPENS DUE TO MERGE STAGE OR I HAVE TO USE LOOK UP STAGE .
Reply me please and thanks for quick reponses
-
- Participant
- Posts: 33
- Joined: Wed May 19, 2010 12:15 am
- Location: Pune