Fatal Error : Primary Key Violated

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
Pankaj
Participant
Posts: 5
Joined: Mon Sep 20, 2004 7:29 pm

Fatal Error : Primary Key Violated

Post by Pankaj »

I have already loaded records into the table. Now when I run the job again it checks that the records exist so no records to be added. I have a surrogate key generator right before loading into the final table. Although there are no records to enter... I get this error...

oraD_Channel: Oracle call failed: sqlcode = -2,437
Message: ORA-02437: cannot validate (PCADEV.SYS_C003336) - primary key violated
oraD_Channel: ExecuteImmediate failed for:
alter table PCADEV.D_CHANNEL enable constraint SYS_C003336

The key being passed as the start value to the surrogate key generator is start key = last key+1

Inspite of this I am hitting this error.
gh_amitava
Participant
Posts: 75
Joined: Tue May 13, 2003 4:14 am
Location: California
Contact:

Post by gh_amitava »

Hi,

If your primary key of the table is a running sequence then you have to modify your insert SQl that you are using in datastage (Check the datastage manual for Oracle insert). Otherwise you can use a "Upsert" option for Update/Insert operation.

Regards
Amitava
Post Reply