Oracle Tutorial: ORA-02292 and ORA-02297

Source: Internet
Author: User
Delete data from a table with the following error: ldquo; ORA-02292: violation of the complete constraints (UNITELE. ta_sub_referene3)

To delete the data of a table, the following error occurs: ldquo; ORA-02292: Full constraint condition (UNITELE. ta_sub_referene3)-the sub-record rdquo is found ;. The table has a primary key.

When you delete data from a table, the following error occurs: ORA-02292: Full constraint condition (UNITELE. ta_sub_referene3)-subrecord found ". If the table already has a primary key, the primary key constraint is invalid.

Alter table table_name modify constraint PK_SUB_TASK_T DISABLE;

The error "ORA-02297: Unable to disable constraints (UNITELE. PK_SUB_TASK_T)-correlated" is reported"

This indicates that the table's primary key is used as a foreign key by other tables, and cascade must be added if the restriction is invalid.

Alter table table_name modify constraint PK_SUB_TASK_T disable cascade;

Or alter table table_name disable constraint PK_SUB_TASK_T CASCADE;

In this way, you can delete the data, but after deleting the data, you must set the primary key constraint to valid. Because cascade is used previously, it will also affect the constraint that other tables use this primary key as a foreign key. Therefore, the Union is set to invalid, so it must be set back.

Which of the following tables will be affected?

Select CONSTRAINT_NAME, TABLE_NAME from dba_constraints

Where r_constraint_name = 'pk _ SUB_TASK_T ';

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.