Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Bulk table update returning ORA-00001: unique constraint

444136Jun 6 2006 — edited Jun 6 2006
I'm trying to update every record in a PROPERTY table that has a CLASS of either 1 or 9 and a STATUS of 'LHLD'. CLASS and STATUS descriptor records are in different tables to the PROPERTY table but reference the PROPERTY records by the PROPERTY tables unid.

I have wrote the following update command,

------------------------------------------------------------------------

UPDATE RNT_PROPERTY_DESCRIPTOR SET DESCRIPTOR = 'PROP', DESCRIPTOR_VALUE = '1', EFFECT_DATE = '01-APR-04', USER_ID = 'USER'
WHERE RNT_PROPERTY_DESCRIPTOR.UNID IN (SELECT PROPERTY.UNID FROM PROPERTY, PROPERTY_CLASS_STATUS
WHERE PROPERTY_CLASS_STATUS.PROP_CLASS = '1'
OR PROPERTY_CLASS_STATUS .PROP_CLASS = '9'
AND PROPERTY.UNID IN (SELECT PROPERTY.UNID FROM PROPERTY, PROP_STATUS_HIST
WHERE PROP_STATUS_HIST.code = 'LHLD'));

------------------------------------------------------------------------

However, after executing for around 10 mins the process update fails and the following error is returned:

ORA-00001: unique constraint (RNT_PROPERTY_DESCRIPTOR_IDX) violated

I know that the IDX suffix refers to the table INDEX but I'm not sure why I'm getting a key constraint, none of the colums that I'm trying to update must be unique.

For info the PROPERTY table has around 250,000 rows.

Any ideas? Is there an error in my update statement?

Thanks in advance.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 4 2006
Added on Jun 6 2006
26 comments
1,127 views