Oracle Database (ORA-02270: unique or primary key mismatch for this list) Problems

Source: Internet
Author: User

Oracle Database (ORA-02270: the unique or primary key mismatch for this list) problem was just encountered when writing an oracle database. You cannot find the answer you want on the Internet. I keep thinking about these words. Then, remind me by friends in the group. It turns out that foreign key tables lack unique constraints. Example: www.2cto.com foreign key table: SQL code create table users (uids integer not null, username nvarchar2 (20) unique not null, passwords nvarchar2 (30) not null, udatatime timestamp default sysdate, udescriptions nvarchar2 (255) null); primary table SQL code create table roleUsers (ruid integer primary key, rid int not null, uids int not null, rudescriptions nvarchar2 (255) null, constraint fk_roleUsers_users foreign key (uids) ref Erences users (uids), constraint fk_roleUsers_role foreign key (rid) references role (rid); If the primary key is not added to the foreign key table (unique constraint ), when the primary table references a foreign key, the following error is reported: "ORA-02270: unique or primary key mismatch in this list!

Related Article

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.