rkaras
Member
Our sales update log shows several errors -- unique constraint (proddta.f4229_1) violated when it tries to do an update on the F4229 table.
This constraint is:
--CREATE UNIQUE INDEX F4229_1 ON F4229(SSAN8, SMCU, SSDCTO, SSITM, SSLNTY, SSSRP1, SSSRP2, SSRP3, SSSRP4, SSSRP5, SSFY) TABLESPACE PRODDTAI PCTFREE 10 STORAGE(INITIAL 65536 )
It looks like the update SQL is trying to set many fields, including ssfy (fiscal year). The UPDATE SQL tries to set the fiscal year to 1 but the WHERE clause doesn't specifiy a fiscal year so it may select as many as 4 records for this particular customer -- for fiscal year 98,99, 0, and 1. The update causes a constraint error because it is trying to set all 4 of these records to fiscal year 1.
What is going on? Shouldn't the WHERE clause have a check to see if fiscal year (ssfy) = 01? Otherwise it is trying to update the ssfy to 01 for all 4 fiscal years. How do I resolve this?
This constraint is:
--CREATE UNIQUE INDEX F4229_1 ON F4229(SSAN8, SMCU, SSDCTO, SSITM, SSLNTY, SSSRP1, SSSRP2, SSRP3, SSSRP4, SSSRP5, SSFY) TABLESPACE PRODDTAI PCTFREE 10 STORAGE(INITIAL 65536 )
It looks like the update SQL is trying to set many fields, including ssfy (fiscal year). The UPDATE SQL tries to set the fiscal year to 1 but the WHERE clause doesn't specifiy a fiscal year so it may select as many as 4 records for this particular customer -- for fiscal year 98,99, 0, and 1. The update causes a constraint error because it is trying to set all 4 of these records to fiscal year 1.
What is going on? Shouldn't the WHERE clause have a check to see if fiscal year (ssfy) = 01? Otherwise it is trying to update the ssfy to 01 for all 4 fiscal years. How do I resolve this?