System tables with two record constraints in Oracle

Source: Internet
Author: User

The following two system tables are used to query the table where a constraint is located.

User_constraints constraints table, which records all constraints of the user. Such as non-null and index.

User_cons_columns constraint field table, which records all fields involved in each constraint.

For example, if I want to delete a record in the TBL_USER table now, an error is reported: ORA-02292 integrity constraint (ESAWEB. FK_TBL_USER_REFERENCE_TBL_USER) violated-child record found. an error indicates that a column in the TBL_USER table has a foreign key constraint. In this case, you need to find and delete records in the table with this foreign key constraint.

Select * from user_constraints t where t. CONSTRAINT_NAME = 'fk_tbl_user_reference_tbl_user ';

Find the value in the TABLE_NAME field. The value here is the table with the FK_TBL_USER_REFERENCE_TBL_USER constraint. Find the corresponding record in the table and delete it.

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.