Page 1 of 1

Fatal Error : Primary Key Violated

Posted: Wed Sep 29, 2004 9:44 pm
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.

Posted: Sun Oct 03, 2004 11:13 am
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