Duplicate row error in <DB_NM>.<TBL_NM>. Teradat

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
durgaps
Participant
Posts: 74
Joined: Sat Jul 08, 2006 4:09 am
Location: Melbourne, Australia
Contact:

Duplicate row error in <DB_NM>.<TBL_NM>. Teradat

Post by durgaps »

Duplicate row error in <DB_NM>.<TBL_NM>. Teradata DB.
------------------------------------------------------

RowGen -----> TeradataPX Stage

There is an INSERT sql in the Teradata PX stage. There are a series of insertions happening on the target tbl in this job.
Insert into #TBL_NM_2# ( Select * from #TBL_NM_1# where #COL_NM# = 'value');

Job run 1
1st set of data to be loaded:
----------------
1
2
3

Job successful.


Job run 2 - with a different set of params.
2nd set of data to be loaded:
----------------
3
4
5
6

Job ends with a warning. Error msg: Duplicate row error in <DB_NM>.<TBL_NM>

Obviously this is because of the duplicate row with value '3'. Problem is due to this even the other rows with data '4','5' & '6' are getting dropped.

How can I get around this problem with the same job design?


I tried with the following job design, with the same sql divided among the 2 stages:


TeradataPX Stage 1 -----------------> TeradataPX Stage 2

( Select * from
#TBL_NM_1# where --------------> Insert into #TBL_NM_2# ....
#COL_NM# = 'value');



This time the desired result was obtained. i.e. row 3 was dropped and the other new rows in the 2nd set of data were loaded into the target tbl.
I couldnt understand the difference b/w the 2 approaches.

Can anybody please throw some lights here.

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

Post by ray.wurlod »

If you've set "All rows = one transaction" then you would expect rows for 4, 5 and 6 to be rolled back (not quite the same as dropped, but the same effect). Use one row per transaction to cure that particular issue.
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