Oracle Upsert errors
Posted: Tue Jun 10, 2008 7:51 am
Hi,
I have a strange problem going on with a job design.
Job has 2 ORA stages. Source ORA stage is executing a SELECT on source table and pulling some data for a couple of columns. Target ORA stage is executing an Upsert - If seq_no (key column) exists then execute an Update else execute an Insert.
problem is that - when target table is empty, the insert is executed and records pulled from source table are inserted to target and there is no warning or error message on job and counts are correct. But data is inconsistent., in the sense, for some records, randomly, instead of the column values nulls are inserted to target table.
Is it due to some partitioning or job design flaw?
To be more clear, let me explain with example
Can anyone suggest things to change in this design to make it work right?
thanks in advance
I have a strange problem going on with a job design.
Job has 2 ORA stages. Source ORA stage is executing a SELECT on source table and pulling some data for a couple of columns. Target ORA stage is executing an Upsert - If seq_no (key column) exists then execute an Update else execute an Insert.
problem is that - when target table is empty, the insert is executed and records pulled from source table are inserted to target and there is no warning or error message on job and counts are correct. But data is inconsistent., in the sense, for some records, randomly, instead of the column values nulls are inserted to target table.
Is it due to some partitioning or job design flaw?
To be more clear, let me explain with example
Code: Select all
source records
----------------
seq_no colA colB colC
----------------------------------------------------
1 abc def ghi
2 jkl mno pqr
3 aaa bbb ccc
Target records (after job is run)
--------------------------------------
seq_no colA colB colC
---------------------------------------------
1 abc def ghi
2 <NULL> mno pqr
3 aaa <NULL> <NULL>
thanks in advance